
Dynamic embed of BOTR (JW platform) player
Hi,
what is the recommended way for embedding a player dynamically? So far I tried it with no luck inside a handlebars template and also in doing it this way:
bc.. var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'http://content.jwplatform.com/players/'+ talk.video_id + '-' + config.default_player_id + '.js';
this.$speakerVideoView.append(script);
Both ways fail with the error: "Failed to execute 'write' on 'Document': It isn't possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened."
Certainly, I could just put in an embed code with a useless default video and change it to the desired one just after initializing via js:
bc.. jwplayer().load("http://content.bitsontherun.com/jwp/KEY.xml");
But theres a better solution, isnt it?
Thanks
Ren