javascript - Rails VideoJS swf-Flash-Fallback asset_path -


i trying embed videojs in rails-app, works fine long don't have use flash-fallback, e.g. in firefox. hosting videojs locally. here have far in javascript:

videojs.options.techorder = ['flash']; videojs.options.flash.swf = "#{asset_path(video-js/video-js.swf)}"; 

i using techorder force flash time beeing. if open page in firefox

get http://localhost:3000/path/to/site/videos#{asset_path(video-js/video-js.swf)} 

the error message, video not supported disappears , playbutton appears. leads me belive, flashplugin not loaded (especially since think not right). hint error is, appreciated.

you can try use gem js_assets

in application.js

//= require app_assets 

this directive adds method asset_path in global scope.

add filter files *.swf. this, add initizlizer:

# config/initializers/js_assets.rb  jsassets::list.allow << '*.swf' 

to path file video-js.swf depending on environment

videojs.options.flash.swf = asset_path("video-js/video-js.swf"); 

Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -