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

modal window issue


Hi

We have been using jwplatform in wordpress using the shortcode embeding method, eg. [bitsontherun 6Oo4bZvz]. The video is in a modal window

We had an issue where the player would continue playing when the modal window was closed in IE browers. We added jwplayer.stop() to our modal window close script and set the wmode to opaque. This fixed the issue.

However, the jwplatform players have since updated to version 6.9.4867 and the bug has re-appeared in all IE browsers including IE11 despite the same fixes applied (jwplayer.stop() and the wmode = opaque). Can you tell us how we fix this bug for IE so that video stops when out modal window is closed.

Thank you

13 Community Answers

Ethan Feldman

JW Player Support Agent  
0 rated :

Do you have an example link that we can look at?

botr

User  
0 rated :

Yes, if you hover over the "+" and look at "stock control" you will see an example video in a modal window. When you close the modal the video stops in all modern browsers except IE (anything from IE8 - 11). we are using jwplayer.stop() on the modal close script.

http://liquidsmeanlife.co.uk/factory-tour/glass-process/

As I said previously this all worked until a recent update of the players to this version.

Ethan Feldman

JW Player Support Agent  
0 rated :

I just checked in IE11 and when I close the player with the X button, the video stops fine. Sound stops.

botr

User  
0 rated :

Sometimes the first video works, if you try "glass" on the same page it will continue to play

Ethan Feldman

JW Player Support Agent  
0 rated :

That is because you are calling jwplayer().stop(), which only references the first player instance on a page. You need to also reference the 2nd player.

botr

User  
0 rated :

How would that be done in order to stop all of the players on the page?

Ethan Feldman

JW Player Support Agent  
0 rated :

just do jwplayer().stop;jwplayer(‘player2’).stop();

Etc

botr

User  
0 rated :

Is there not a class that you can get the players by? this page has about 10 players on it. There must be away to reference multiple players rather than by each single id?

Ethan Feldman

JW Player Support Agent  
0 rated :

Ok, so say there are 10 players on a page:

Use this code:

var maxPlayers = 10;
for(var i = 0; i < maxPlayers; i++) {
var player = jwplayer(i).id;
jwplayer(player).stop();
}

botr

User  
0 rated :

Would that not mean that players would need to have id's of "1", "2", "3", etc?

Ethan Feldman

JW Player Support Agent  
2 rated :

It doesn’t mean that. This is just looping through player instances.

botr

User  
1 rated :

Thank you very much for your help I will give that a go then.

Ethan Feldman

JW Player Support Agent  
-1 rated :

Np.

I tested this locally and it works.

Here is some code using 2 players – https://gist.github.com/emaxsaun/c878cb1f6ab5168855f9

This question has received the maximum number of answers.