Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Embedding a signed URL player info a n async loaded modal


Hi,

I am working on a project for a client and have a modal window which is launched when selecting a resource (webinar videos in card/grid format). Depending upon permissions and the relevant view formatting (preferences/responsive etc), the modal html is rewritten asynchronously with a new partial view.

I want to embed a player within that partial view but because it has been loaded asynchronously i get 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.

In the embed script, the player tries to do a document.write which seems to be causing the error.
Does anyone have any suggestions? The URL loaded is dynamically written and token signed with md5. the client requires full security which is setup and working.

Thanks!

Howard

1 Community Answers

Cooper Reid

JW Player Support Agent  
-1 rated :

Hello Howard -

Have you considered using the iFrame embed method? This does not make the document.write call that is causing the issue.

I also tested this locally and used this to write my embed Js and did not receive any errors:
var tag = ‘’ + ’ src=“http://content.jwplatform.com/players/XXXXXXXX.mp4?exp=1271762610&sig=b59b91370faf4815b6736db10e5041”></sc’ + ‘ript>’;
document.write(tag);

Best Regards,
Cooper

This question has received the maximum number of answers.