You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
645 B
Ruby
27 lines
645 B
Ruby
11 years ago
|
class PlaybackOptions
|
||
|
|
||
|
include Virtus.model
|
||
|
|
||
|
attribute :speed, Float, default: 1.0
|
||
|
attribute :font_size, String, default: 'small'
|
||
|
attribute :autoplay, Boolean, default: false
|
||
|
attribute :max_width, Integer
|
||
|
attribute :hide_hud, Boolean, default: false
|
||
|
attribute :fallback, Boolean, default: false
|
||
|
attribute :renderer, String, default: 'Pre'
|
||
|
attribute :benchmark, Boolean, default: false
|
||
|
|
||
|
def player_class
|
||
|
if fallback
|
||
|
"Asciinema.FallbackPlayer"
|
||
|
else
|
||
|
"window.Worker ? Asciinema.Player : Asciinema.FallbackPlayer"
|
||
|
end
|
||
|
end
|
||
|
|
||
|
def renderer_class
|
||
|
"Asciinema.Renderer.#{renderer}"
|
||
|
end
|
||
|
|
||
|
end
|