
require.js, AMD and "missing license key"
As happy as I was that jwPlayer is using a compatible format for the js file, I'm currently working with a setup including require.js and I'm getting a player on my site but it shows "Error setting up player: Missing license key".
# This is in the template file
<div id="jwPlayerWrapper"></div>
require(['jwplayer','initJwplayer'], function(jwplayer, BackgroundJwPlayer) {
jwplayer.key="[HereWouldBeMyKey]"; //tried this first
var controller = new BackgroundJwPlayer('jwPlayerWrapper', jwplayer);
controller.init();
});
The alias jwplayer points to the original player script downloaded from my account dashboard that initializes/returns the jwplayer object.
The file behind initJwplayer contains the init of the BackgroundJwPlayer object and calling the init function on this will set up the player.
I tried defining the key from within the require block inside the template as well as insite the init function before calling jwplayer.setup, both with little success.
Everything else seems to work fine, the player is initialized, recognized and stuff... only the key is missing, even though its there.
Any help greatly appreciated.