Allow overriding player cols & rows via query params

This commit is contained in:
Marcin Kulik 2017-07-27 14:21:54 +02:00
parent cd10c59a46
commit c4e494e224
2 changed files with 4 additions and 2 deletions

View File

@ -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,

View File

@ -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