Sha256: 5ef0f45952a50f9cc92a5290292662bc9f7245d959b1ff9323412398a8cab8f2

Contents?: true

Size: 794 Bytes

Versions: 4

Compression:

Stored size: 794 Bytes

Contents

module Maglove
  module Widgets
    class Video < Base
      def identifier
        "video"
      end

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

      def template(&block)
        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
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
maglove-widgets-2.0.5 lib/maglove/widgets/video.rb
maglove-widgets-2.0.4 lib/maglove/widgets/video.rb
maglove-widgets-2.0.3 lib/maglove/widgets/video.rb
maglove-widgets-2.0.2 lib/maglove/widgets/video.rb