Module: VideoJsHelper

Defined in:
app/helpers/video_js_helper.rb

Instance Method Summary collapse

Instance Method Details

#video_player(*args) ⇒ Object



2
3
4
5
6
7
8
9
# File 'app/helpers/video_js_helper.rb', line 2

def video_player *args
  options = { width: 640, height: 360, class: 'video-js vjs-default-skin', :'data-setup' => '{}' }.merge args.extract_options!
  src = options.delete(:src) || {}

   :video, options do
    raw src.map { |type, url| raw tag(:source, src: url, type: "video/#{type}") }.join('')
  end
end