class Maglove::Widgets::Youtube

Public Instance Methods

defaults() click to toggle source
# File lib/maglove/widgets/youtube.rb, line 8
def defaults
  {
    youtube_id: "LFYNP40vfmE",
    width: "800",
    height: "600"
  }
end
identifier() click to toggle source
# File lib/maglove/widgets/youtube.rb, line 4
def identifier
  "youtube"
end
template(&block) click to toggle source
# File lib/maglove/widgets/youtube.rb, line 16
def template(&block)
  haml_tag :div, class: "flex-video widescreen", style: style_string(options) do
    haml_tag :iframe, src: "https://www.youtube.com/embed/#{options[:youtube_id]}", type: "text/html", style: "max-width: 100%; position: absolute; top: 0px; left: 0px; width: 100%; height: 100%;", allowfullscreen: "", frameborder: "0", webkitallowfullscreen: "", mozallowfullscreen: ""
  end
end