Sha256: b67f41e2ee2eb70d2432275accdf223fbc317c51bb6fc2cb190211e0222ae49e

Contents?: true

Size: 965 Bytes

Versions: 14

Compression:

Stored size: 965 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

      module Helpers
        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
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
maglove-widgets-1.1.9 lib/maglove/widgets/video.rb
maglove-widgets-1.1.8 lib/maglove/widgets/video.rb
maglove-widgets-1.1.7 lib/maglove/widgets/video.rb
maglove-widgets-1.1.6 lib/maglove/widgets/video.rb
maglove-widgets-1.1.5 lib/maglove/widgets/video.rb
maglove-widgets-1.1.4 lib/maglove/widgets/video.rb
maglove-widgets-1.1.3 lib/maglove/widgets/video.rb
maglove-widgets-2.0.1 lib/maglove/widgets/video.rb
maglove-widgets-1.0.8 lib/maglove/widgets/video.rb
maglove-widgets-1.0.7 lib/maglove/widgets/video.rb
maglove-widgets-1.0.6 lib/maglove/widgets/video.rb
maglove-widgets-2.0.0 lib/maglove/widgets/video.rb
maglove-widgets-1.0.5 lib/maglove/widgets/video.rb
maglove-widgets-1.0.4 lib/maglove/widgets/video.rb