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

onReady event fired multiple times


If you render in flash mode, and then do anything with the DOM surrounding the player which causes a re-paint (such as moving the player container using JavaScript and absolute positioning, or simply hiding and showing it), then the onReady function is called again - each time.

James Herrieven

3 Community Answers

Andrew

JW Player Support Agent  
0 rated :

Hey James,

I can definitely pass this over to the devs. Do you have an example that we can look at?

jherrieven

User  
0 rated :

Sure. Go to this page:

http://support.jwplayer.com/customer/portal/articles/1430358-using-rtmp-streaming

Then using the console in chrome (for example), attach the following onReady listener:

jwplayer().onReady(function(){alert('on ready');})

Then use the following in the console to modify the display style:

jwplayer().container.style.display='none'

and

jwplayer().container.style.display='block'

You'll see the alert is fired each time the player is made visible.

This occurs in both Chrome & FF. In Chrome it also occurs when you modify the "position" style in a way which the player is caused to move.

James

Andrew

JW Player Support Agent  
0 rated :

Thanks James. We’ll get working on repro steps on our end.

This question has received the maximum number of answers.