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

Dynamically Loaded Videos with Multiplayer Control


I am on a development team for sites that market business franchises. Our websites are database driven so we constantly add videos for clients upon request. These videos all appear under a video tab so if someone clicks another tab, I would like to have all of the videos stop. I already have this working for one video per client, but if a client has multiple videos on their brochure page, only the last video has the capability of pause while using an anchor tag other than the video. I would like to be able to use the same anchor tag to stop all videos at once instead of having individual control thru my tabs. Is that possible?

3 Community Answers

George

JW Player Support Agent  
0 rated :

Hi,

I am not sure what you are trying to do, but from what I understand you were able to get one player to pause when you switch tabs and you want to pause multiple players. You will always need separate id’s for each JW Player because that’s how you can manage the players.

To better assist you please provide two websites that demonstrate the success and failures you have encountered and perhaps we can find a work around.

Website that pauses successfully when switching tabs:

Website that fails to pause when switching tabs:

Sincerely,
George
JW Player
Support Engineer

jherrieven

User  
0 rated :

Since you've been waiting >4 days for a response from the JW Team, I thought I'd offer you an alternative avenue - email me and I'll help you get this working: james[at]haiku[dot]co[dot]uk

James Herrieven

Todd

JW Player Support Agent  
0 rated :

We do not have a built-in function for this, but you can certainly write a Javascript function to iterate through all the instances of jwplayer() on the page and pause each one. It would look something like this if you had three different players on the same page:

<div id="video1">Loading the player…</div> <div id="video2">Loading the player…</div> <div id="video3">Loading the player…</div>

<br><br> <input type=button value=Pause onClick=“pauseAll()”>
<script type="text/javascript">

function pauseAll() {
for (var i=0; i<3; i++) {
jwplayer(i).pause(true);
}
}

jwplayer(“video1”).setup({
file: ‘bunny.mp4’
});
jwplayer(“video2”).setup({
file: ‘bunny.mp4’
});
jwplayer(“video3”).setup({
file: ‘bunny.mp4’
});
</script>

This question has received the maximum number of answers.