seanbehan / videojs_rails

Video JS for Rails 3.1 Asset Pipeline
91 stars 71 forks source link

Not able to add controls and unset preload #11

Closed abhishek77in closed 9 years ago

abhishek77in commented 10 years ago

I am trying -

<%= videojs_rails sources: { mp4: "url", webm: "url", ogg: "url" },
                                     controls: true,
                                     "data-setup"  => '{ "controls": true, "autoplay": false, "preload":  false }',
                                     poster: image_path("url") %>

Options taken from video js readme

I tried different possible combinations but it doesn't seem to work. I hope its possible to configure these values.

mcfadden commented 10 years ago

Looking into the code, it looks like those settings are hard coded and not configurable yet:

https://github.com/seanbehan/videojs_rails/blob/master/app/views/videojs_rails/_videojs_rails.html.erb

:+1: for additional configuration here.

grzlus commented 10 years ago

I just merged my changes. Now you could set data-setup and controls using this snippet:

<%= videojs_rails sources: { mp4: "url", webm: "url", ogg: "url" },
                                     controls: false,
                                     setup => '{ "controls": true, "autoplay": false, "preload":  false }',
                                     poster: image_path("url") %>
abhishek77in commented 10 years ago

Great :+1: