Dynamic embed of BOTR (JW platform) player
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.src = 'http://content.jwplatform.com/players/'+ talk.video_id + '-' + config.default_player_id + '.js';
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:
But theres a better solution, isnt it?