I have the licensed version of JW Player 6. I downloaded the files and put them in the assets/javascript directory. Aside from the skins directory, there is a JS file for the HTML5 player as well as a flash.swf file for the flash player. Everything that I've done thus far has worked locally but as soon as I push to Heroku I get errors.
First attempt:
In my application.js
file:
...
//= require jwplayer/jwplayer
//= require jwplayer/jwplayer.html5 # the file name is jwplayer.html5.js
...
After running rake assets:clean ; rake assets:precompile
I get the following error in the view (on Heroku):
An ActionView::Template::Error occurred in nodes#show:
jwplayer/jwplayer.html5.js isn't precompiled
Second attempt:
In my application.js
file:
...
//= require jwplayer/jwplayer
...
Then, I added this to the production.rb
environment config file:
# Also tried %w(jwplayer.html5.js)
config.assets.precompile += %w(jwplayer/jwplayer.html5.js)
After cleaning and precompiling the assets and pushing to Heroku, the original ActionView::Template::Error
was no longer happening, but now the JW Player displays this message:
Error loading player: HTML5 player not found
This is the JW Player initialization in the HAML view:
:javascript
jwplayer("video_display_object_#{display_object.id}").setup({
width: "948",
height: "533",
image: "#{display_object.video_screenshot_url}",
file: "#{display_object.resource_url}",
modes: [
{ type: 'flash',
src: "#{asset_path('jwplayer/jwplayer.flash.swf')}",
config: {
skin: "#{asset_path('jwplayer/skins/beelden.xml')}",
'controlbar.position': 'over',
'controlbar.idlehide': 'true'
}
},
// I've also tried "#{javascript_path('jwplayer/jwplayer.html5.js}"
// And "/assets/jwplayer/jwplayer.html5.js"
{ type: 'html5', src: "#{asset_path('jwplayer/jwplayer.html5.js')}" }
]
});
I don't really know what to do at this point. Like I mentioned earlier, everything works locally, just not on Heroku.
Any suggestions?