Sha256: 7481804e250def39e55088d482b0a50a9fdfe06dd3ccb0839f8c51465afe45f1

Contents?: true

Size: 1.02 KB

Versions: 29

Compression:

Stored size: 1.02 KB

Contents

<%= content_tag(:video,
  id: options[:id],
  class: "#{ options[:classes] } vide-js vjs-default-skin",
  controls: options[:controls],
  loop: options[:loop],
  autoplay: options[:autoplay],
  preload: options[:preload],
  width: options[:width],
  height: options[:height],
  poster: options[:poster],
  'data-setup' => options[:setup]) do 
    if options[:sources]
      options[:sources].each do |type, source|
        concat tag(:source, src: source, type: "video/#{ type }")
      end
    end

    if options[:captions]
      options[:captions].each do |lang, caption|
        if caption.is_a?(Hash)
          caption_src = caption[:src]
          caption_label = caption[:label]
        else
          caption_src = caption
        end

        concat tag(:track, kind: :captions, src: caption_src, srclang: lang, label: caption_label, default: (options[:default_caption_language].present? && options[:default_caption_language].to_sym == lang.to_sym))
      end
    end

    concat content_tag(:p, class: 'vjs-no-js') { yield }
  end
%>

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
videojs_rails-4.8.1 app/views/videojs_rails/_videojs_rails.html.erb
videojs_rails-4.8.0 app/views/videojs_rails/_videojs_rails.html.erb
videojs_rails-4.7.3 app/views/videojs_rails/_videojs_rails.html.erb
videojs_rails-4.7.2 app/views/videojs_rails/_videojs_rails.html.erb
videojs_rails-4.7.1 app/views/videojs_rails/_videojs_rails.html.erb
videojs_rails-4.7.0 app/views/videojs_rails/_videojs_rails.html.erb
videojs_rails-4.6.4 app/views/videojs_rails/_videojs_rails.html.erb
videojs_rails-4.6.3 app/views/videojs_rails/_videojs_rails.html.erb
videojs_rails-4.6.2 app/views/videojs_rails/_videojs_rails.html.erb