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

How to create the custom toolbar


Hello

I have four Video player on my page 2 in a line and other two are below them and I am controlling all from a single control bar but that control bar is attached with the first player but I want a control bar below all which will control to all players.Is it possible to create a control bar only which will control to all 4 players if yes then please help me.

Thanks in advance.

Regards
Gurpinder

2 Community Answers

praveen.nadide

User  
-2 rated :

yes

Todd

JW Player Support Agent  
0 rated :

If you have more than one instance of JW Player on a page, you can refer to each player with a number inside the jwplayer(number). To answer your question, you can create your own buttons and tie a function to each button. For example:

<input type=button value=Play onClick=‘playAll();’>
<input type=button value=Pause onClick=‘pauseAll();’>
<script>
function playAll() {
console.log(‘Playing all players’);
jwplayer(0).play(true);
jwplayer(1).play(true);
jwplayer(2).play(true);
jwplayer(3).play(true);
}

function pauseAll() {
console.log(‘Pausing all players’);
jwplayer(0).pause(true);
jwplayer(1).pause(true);
jwplayer(2).pause(true);
jwplayer(3).pause(true);
}
</script>

If you want the player’s actual control bar to control all the other players on the page as well, you would need your pauseAll() function to be called inside each player’s corresponding event handler. For example:

jwplayer(0).onPause(function(){
pauseAll();
});

This question has received the maximum number of answers.