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

Jwplayer iframe embed (event-listeners not working)


I'm embedding video using iframe. Is there a way to include player event listeners from js?
When I tried doing so, I'm getting the error jwplayer() is not a function, since the player is still not there in the dom.
For instance:

jwplayer().onPlay( function(event){
//code
});

1 Community Answers

Todd

JW Player Support Agent  
0 rated :

Because you have our player in an <iframe>, you would need to add code to both the parent and child pages in order to have Javascript go back and forth between the player and your page. I have seen it done before, but it is not easy.

My suggestion would be to use the Javascript embed method directly on your page instead of the <iframe>.

This question has received the maximum number of answers.