diff --git a/app/helpers/asciicasts_helper.rb b/app/helpers/asciicasts_helper.rb index 6beb257..06d0b28 100644 --- a/app/helpers/asciicasts_helper.rb +++ b/app/helpers/asciicasts_helper.rb @@ -11,8 +11,8 @@ module AsciicastsHelper opts = { id: 'player', src: asciicast.url, - cols: asciicast.width, - rows: asciicast.height, + cols: options.cols || asciicast.width, + rows: options.rows || asciicast.height, poster: options.poster || base64_poster(asciicast), speed: options.speed, autoplay: options.autoplay, diff --git a/app/models/playback_options.rb b/app/models/playback_options.rb index 3b5ed9a..8af2b4c 100644 --- a/app/models/playback_options.rb +++ b/app/models/playback_options.rb @@ -23,6 +23,8 @@ class PlaybackOptions attribute :t, Time attribute :v0, Boolean, default: false attribute :poster, String + attribute :cols, Integer + attribute :rows, Integer def autoplay() ap = super