Class: Maglove::Widget::LegacyVideo

Inherits:
V1
  • Object
show all
Defined in:
lib/maglove/widget/video.rb

Instance Attribute Summary

Attributes inherited from Base

#options, #scope

Instance Method Summary collapse

Methods inherited from V1

#drop_container, #widget_options

Methods inherited from Base

#initialize, #style_string, #widget_options

Constructor Details

This class inherits a constructor from Maglove::Widget::Base

Instance Method Details

#defaultsObject



28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/maglove/widget/video.rb', line 28

def defaults
  {
    width: "640",
    height: "360",
    preload: "auto",
    style: "default",
    source: false,
    poster: false,
    autoplay: false,
    controls: true,
    loop: false,
    margin_bottom: "0"
  }
end

#identifierObject



24
25
26
# File 'lib/maglove/widget/video.rb', line 24

def identifier
  "video"
end

#render(&block) ⇒ Object



43
44
45
46
47
48
49
50
51
# File 'lib/maglove/widget/video.rb', line 43

def render(&block)
  super do
    haml_tag :div, style: "margin-bottom: #{options[:margin_bottom]}", class: "video-widget player-style-#{options[:style]}" do
      haml_tag :video, controls: true, poster: options[:poster], style: "width: 100%" do
        haml_tag :source, src: options[:source].to_s, type: "video/mp4"
      end
    end
  end
end