Module: Maglove::Widgets::Video::Helpers

Defined in:
lib/maglove/widgets/video.rb

Instance Method Summary collapse

Instance Method Details

#video_widget(options = {}) ⇒ Object



24
25
26
27
28
29
30
31
32
# File 'lib/maglove/widgets/video.rb', line 24

def video_widget(options = {})
  widget_block(Widgets::Video.new(options)) do |widget|
    haml_tag :div, style: "margin-bottom: #{widget.options[:margin_bottom]}", class: "video-widget player-style-#{widget.options[:style]}" do
      haml_tag :video, controls: true, poster: widget.options[:poster], style: "width: 100%" do
        haml_tag :source, src: widget.options[:source].to_s, type: "video/mp4"
      end
    end
  end
end