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

How to Start and Stop Multiple Players on One page.


Hi,

The have two demos here that I created that use the new JWPlayer and displays multiple podcasts and videos on one page.

http://www.international.ucla.edu/play/jwplayer5/podcasts.asp


http://www.international.ucla.edu/play/jwplayer5/videos.asp

Each has multiple players.

My goal is to only have 1 player play at a time. so when I click click play on one player the other player(s) pause or stop.

http://qa.longtailvideo.com/~ethan/multiple.html

Ethan Feldman (a very kind, helpful and awesome programmer) showed me a sample that has multiple players on one page that also play all the time and his solution was to links at the bottom of page to play or stop them all at once.

http://qa.longtailvideo.com/~ethan/multiple.html


with a script written like this.

bc.. <a onclick="jwplayer('uniquenameofcontainer').play();jwplayer('uniquenameofcontainer2').play();jwplayer('uniquenameofcontainer3').play();" href="#">Play All Players</a>



bc.. <a onclick="jwplayer('uniquenameofcontainer').stop();jwplayer('uniquenameofcontainer2').stop();jwplayer('uniquenameofcontainer3').stop();" href="#">Stop All Players</a>



He suggested I use a similar script to stop some of the players or pause some of the players with a script like this

bc.. <a href="#" onclick="jwplayer('container').play();jwplayer('container2').stop();jwplayer('container3').stop();">Play All Players</a>


That sort of works, but all players have to be stopped and I have click the link twice to get a particular player to to start.

Again, if all players are playing at the same time already. Clicking the link oncee doesn't stop the players. And I also have to click the link twice to get the javascript to fire the play stop code.


I also saw this sample that fakes the player with images
http://developer.longtailvideo.com/contributors/nyboe/JW_API_xmpl_1-1-3-0.html

I think we need to have a way using the jwplayer("audioplayer121207").setup function to be able to stop or pause other players on the page so we won't have to use the links at all and can fire the action with just using the player play, pause, stop buttons.


I'm opening this forum post about it and will share development of how to solve this issue. If anyone has something to contribute to solve the problem please post to this forum thread as I think other people would like to use ability.


*Wait, Wait. News Flash from Ethan. He just sent me an email that does what we're looking for*

bc.. from Ethan:

"My link is just an example.

You can extend the API to do other things though.

For example - http://qa.longtailvideo.com/~ethan/multiple2.html

For each player, I made it so that when it plays, the other ones stop."



Am reseaching what he did but he may have solved the problem. Woo hoo!


Thanks Ethan. Hats off to you, kind sir,

Scott
www.twitter.com/guyniche

43 Community Answers

Ethan Feldman

JW Player Support Agent  
0 rated :

Np Scott, any time! :-)

JW Player

User  
0 rated :

Check out the events code to see how its done

bc.. <script type="text/javascript">
jwplayer("container").setup({
file: "http://www.longtailvideo.com/jw/upload/bunny.mp4",
image: "http://www.longtailvideo.com/jw/upload/bunny.jpg",
flashplayer: "http://player.longtailvideo.com/player.swf",
height: 200,
width: 300,
controlbar: "bottom",
stretching: "exactfit",
events:{
onPlay: function() {
jwplayer('container2').stop();jwplayer('container3').stop();
}
}
});
</script>




bc.. <div id="container2"></div>
<script type="text/javascript">
jwplayer("container2").setup({
file: "http://www.longtailvideo.com/jw/upload/bunny.flv",
image: "http://www.longtailvideo.com/jw/upload/bunny.jpg",
flashplayer: "http://player.longtailvideo.com/player.swf",
height: 200,
width: 300,
controlbar: "bottom",
stretching: "exactfit",
events:{
onPlay: function() {
jwplayer('container').stop();jwplayer('container3').stop();
}
}
});
</script>

Ethan Feldman

JW Player Support Agent  
0 rated :

Yeah :) This implementation is actually pretty simple with the new API. Basically for every instance of the player, while playing, stop the other ones :)

Ethan Feldman

JW Player Support Agent  
0 rated :

I actually noticed an issue in the link I had sent where it would require multiple clicks sometimes to make the video players play again.

I also added a feature where it stops on the last frame (people have requested this).

This is how to do this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <script type="text/javascript" src="http://player.longtailvideo.com/jwplayer.js"></script>
		<title>Multiple 3</title>
    </head>
	<body>
			<div id="container"></div>
			<script type="text/javascript">
			jwplayer("container").setup({
			file: "http://www.longtailvideo.com/jw/upload/bunny.mp4",
			image: "http://www.longtailvideo.com/jw/upload/bunny.jpg",
			flashplayer: "http://player.longtailvideo.com/player.swf",
			height: 200,
			width: 300,
			controlbar: "bottom",
			stretching: "exactfit",
			events:{
				onPlay: function() {
				jwplayer('container2').stop();jwplayer('container3').stop();jwplayer('container2').pause();jwplayer('container3').pause();
				},
				onTime: function(object) {
				if(object.position > object.duration - 1) {this.pause();}
				}
			}
			});
			</script>

			<br />
			<div id="container2"></div>
			<script type="text/javascript">
			jwplayer("container2").setup({
			file: "http://www.longtailvideo.com/jw/upload/bunny.flv",
			image: "http://www.longtailvideo.com/jw/upload/bunny.jpg",
			flashplayer: "http://player.longtailvideo.com/player.swf",
			height: 200,
			width: 300,
			controlbar: "bottom",
			stretching: "exactfit",
			events:{
				onPlay: function() {
				jwplayer('container').stop();jwplayer('container3').stop();jwplayer('container').pause();jwplayer('container3').pause();
				},
				onTime: function(object) {
				if(object.position > object.duration - 1) {this.pause();}
				}
			}
			});
			</script>
			<br />
			<div id="container3"></div>
			<script type="text/javascript">
			jwplayer("container3").setup({
			file: "http://www.longtailvideo.com/jw/upload/bunny.mov",
			image: "http://www.longtailvideo.com/jw/upload/bunny.jpg",
			flashplayer: "http://player.longtailvideo.com/player.swf",
			height: 200,
			width: 300,
			controlbar: "bottom",
			stretching: "exactfit",
			events:{
				onPlay: function() {
				jwplayer('container').stop();jwplayer('container2').stop();jwplayer('container').pause();jwplayer('container2').pause();
				},
				onTime: function(object) {
				if(object.position > object.duration - 1) {this.pause();}
				}
			}
			});
			</script>
	</body>
</html>

JW Player

User  
0 rated :

Hi folks,
after hours of testing i decided to ask for help:

I got 4 movies in one page. I'm using a spry-Element which is repeated. The hole information comes out of a xml-file.
My "containers" are called 'player1', 'player2'...

And the problem is, I can't stop the movies. In this setup I tried it hardcoded ( jwplayer('player1').stop();jwplayer('player3').stop(); ) and even that does not work.
Finally I want to use a variable for 'player1'.2.3... how is the right syntax for that?

Thanks for your help!
Alex

http://kuekenthal.com/index_2.html

bc.. <!-- START OF THE PLAYER EMBEDDING -->
<div id="player{nr}">
<script type="text/javascript">
var film = "{film}";
var nr = "{nr}";
jwplayer("player{nr}").setup({
flashplayer: "mov/player.swf",
image: 'mov/'+ film +'.jpg',
controlbar: "over",
'controlbar.idlehide': "true",
'hideLogo': "true",
height: "353",
width: "628",
levels: [
{ file: 'mov/'+ film +'.mp4' }, // H.264 version
{ file: 'mov/'+ film +'.flv' }, // WebM version
{ file: 'mov/'+ film +'.ogv' }, // Ogg Theora version
],
events:{
onPlay: function() {
jwplayer('player1').stop();jwplayer('player3').stop();
}
}
});
</script></div>
<!-- END OF THE PLAYER EMBEDDING -->


Ethan Feldman

JW Player Support Agent  
0 rated :

You are putting your variables inside of double quotes, so the player is actually being called “player{nr}”, so that is why player1, player2, player3, etc is not working.

JW Player

User  
0 rated :

ok, but if I use single quotes jwplayer('player{nr}') it is the same result.

Ethan Feldman

JW Player Support Agent  
0 rated :

JavaScript variables do not have quotes around them, at all.

JW Player

User  
0 rated :

This is interesting, any chance of getting the 2nd, 3rd and for me 4th instances of the player to start playing from the same time as the 1st one got stopped?

This is a question since I'm looking at a multi-angle camera setup and the client wants people to be able to choose which angle and it should pick up roughly where they where before they clicked on the new angle.

The only way of doing this, until now, is to hide div's and have 4 streams running simultaneously, but it's a bandwidth hog both for me and for the viewer.

JW Player

User  
0 rated :

I've 'sort' of got it working between two players but the next step is to somehow check WHICH player is playing so I can getPosition() from that player when the user changes view. Anyone have some working code for that? (I suck at Javascript) :)

Ethan Feldman

JW Player Support Agent  
1 rated :

Hm, can I see where this is running?

JW Player

User  
1 rated :

Currently no, but I'm working on it :) I'll get back to you, also discussing with the client about doing one playerwindow and that would make it easier with just adding buttons to check where the player is and reload video and then seek to that point.

Ethan Feldman

JW Player Support Agent  
1 rated :

Ok, please do :)

JW Player

User  
0 rated :

Hi,

sorry for my English.

For displaying multiple videos with just one playing at time, i use this :
bc.. $html .= '<div id="container'.$nbVideo.'"></div>
<script type="text/javascript">
var idPlayer = "container'.$nbVideo.'";

jwplayer("container'.$nbVideo.'").setup({
file: "'.$objRequestAccueil->getFileVideo().'",
flashplayer: "jwplayer/player.swf",
image: "",
height: "270",
width: "480",
stretching: "fill",
autostart: "true",
controlbar: "bottom",
events: {
onPlay: function(event)
{
if(this.id != idPlayer)
{
jwplayer(idPlayer).stop();
idPlayer = this.id
}
}
}
});
</script>

$nbVideo++;

$html .= '<div id="container'.$nbVideo.'"></div>

<script type="text/javascript">
jwplayer("container'.$nbVideo.'").setup({
file: "'.$objRequestAccueil->getFileVideo().'",
flashplayer: "jwplayer/player.swf",
image: "",
height: "270",
width: "480",
stretching: "fill",
controlbar: "bottom",
events: {
onPlay: function(event)
{
if(this.id != idPlayer)
{
jwplayer(idPlayer).stop();
idPlayer = this.id
}
}
}
});
</script>';
$nbVideo++;



My script is php and javascript.

Best regards

Azimuth

Ethan Feldman

JW Player Support Agent  
0 rated :

Thanks!

JW Player

User  
0 rated :

how can i do if i am using iframe and link in it to the video instead of any plugin in that code...

JW Player

User  
0 rated :

Hi Sam,

I'm not sure to understand but this link demonstrate how to make communication to and from Iframes :

http://www.dyn-web.com/tutorials/iframes/refs.php

++

Ethan Feldman

JW Player Support Agent  
0 rated :

Here are a few samples, too:

http://developer.longtailvideo.com/contributors/nyboe/JW_API_xmpl_7-2-1-0.html
http://developer.longtailvideo.com/contributors/nyboe/JW_API_xmpl_7-2-2-0.html
http://developer.longtailvideo.com/contributors/nyboe/JW_API_xmpl_7-2-3-0.html

JW Player

User  
0 rated :

Stop() works great for multiple players if fired from the onPlay event for each player, but I am having an issue pausing between players. If I use the event onPlay for the current video and set it to pause() the other player, it toggles the pause() action instead of just setting it to pause. So clicking on the same link over and over cycles pause/play between the two players.

Any way to to set it to pause without it toggling back to play if it is already paused or not playing?

Here is an example of the code I'm using that works fine to stop
bc.. <div id="music-player-1"></div>
<script type="text/javascript">
jwplayer('music-player-1').setup({
'id': 'music_player_1',
'width': '250',
'height': '550',
'skin': '/JWPlayer-5/nacht/nacht.zip',
'controlbar.position': 'bottom',
'stretching': 'exactfit',
'controlbar.idlehide':'false',
'repeat': 'list',
'wmode': 'transparent',
'players': [
{type: 'flash', src: '/JWPlayer-5/player.swf'},
{type: 'html5'},
{type: 'download'}
], 'playlist': [
{ file: '/wp-content/uploads/2012/12/Rells-Fargo-2pac-or-Biggie.mp3', image: 'http://dev.mp3waxx.com/wp-content/uploads/2012/12/rellsfargo-nm-site-150x112.jpg', description: 'Rells Fargo', title: '2pac or Biggie' } ,{ file: '/wp-content/uploads/2012/12/Jaey-Tunes-ft.-Young-Dirt-45-Days-Main.mp3', image: 'http://dev.mp3waxx.com/wp-content/uploads/2012/12/jaeytunes-nm-site-150x112.jpg', description: 'JaEy Tunes ft. Young Dirt', title: '45 Days' } ,{ file: '/wp-content/uploads/2012/11/Wale-ft.-Rick-Ross-Omarion-Lil-Wayne-Yo-Gotti-French-Montana-Black-Cobain-T-Pain-Bag-of-Money-Remix-MP3WAXX.mp3', image: 'http://dev.mp3waxx.com/wp-content/uploads/2012/12/wale.jpg', description: 'Wale ft. Rick Ross, Omarion, Lil Wayne, Yo Gotti, French Montana, Black Cobain & T-Pain', title: 'Bag of Money Remix' } ,{ file: '/wp-content/uploads/2012/11/T.I.-ft.-Lil-Wayne-Ball-MP3WAXX.mp3', image: 'http://dev.mp3waxx.com/wp-content/uploads/2012/12/ti.jpg', description: 'T.I. ft. Lil Wayne', title: 'Ball' } ,{ file: '/wp-content/uploads/2012/11/Marcus-iLLy-BBW-Clean1.mp3', image: 'http://dev.mp3waxx.com/wp-content/uploads/2012/12/marcusilly-bbw.jpg', description: 'Marcus iLLy', title: 'BBW' } ,{ file: '/wp-content/uploads/2012/12/Rick-Ross-ft.-Diddy-Birthday-REMIX-MP3WAXX.mp3', image: 'http://dev.mp3waxx.com/wp-content/uploads/2012/12/rickross.jpg', description: 'Rick Ross ft. Diddy', title: 'Birthday REMIX' } ,{ file: '/wp-content/uploads/2012/12/Alicia-Keys-Brand-New-Me-MP3WAXX.mp3', image: 'http://dev.mp3waxx.com/wp-content/uploads/2012/12/aliciakeys.jpg', description: 'Alicia Keys', title: 'Brand New Me' } ,{ file: '/wp-content/uploads/2012/12/Bruno-Mars-When-I-Was-Your-Man-MP3WAXX.mp3', image: 'http://dev.mp3waxx.com/wp-content/uploads/2012/12/brunomars-nm-site-150x112.jpg', description: 'Bruno Mars', title: 'Bruno Mars - When I Was Your Man' } ,{ file: '/wp-content/uploads/2012/11/DJ-Scream-ft.-Rick-Ross-Bun-B-Slim-Thug-Cassette-Deck-Dirty1.mp3', image: 'http://dev.mp3waxx.com/wp-content/uploads/2012/12/djscream-cassettedeck.jpg', description: 'DJ Scream ft. Rick Ross Bun-B & Slim Thug', title: 'Cassette Deck' } ,{ file: '/wp-content/uploads/2012/12/Kanye-West-ft.-Big-Sean-Jay-Z-Clique-MP3WAXX.mp3', image: 'http://dev.mp3waxx.com/wp-content/uploads/2012/12/kanyewest.jpg', description: 'Kanye West ft. Big Sean & Jay-Z', title: 'Clique' } ],
'playlist.position': 'bottom', 'playlist.size': '525',
events: {
onPlay: function() {
jwplayer('video-player-1').stop();
},
onPlaylistItem: function(evt) {
var playlistitem = this.getPlaylistItem();
jQuery('#current-image').attr('src',playlistitem.image);
jQuery('#current-song').html(playlistitem.title);
}
}
});</script>


Ethan Feldman

JW Player Support Agent  
0 rated :

Do you have a link?

JW Player

User  
0 rated :

I have a question a little different for you guys!
I want to use 2 players synchronously. When I trigger the play in one, both run together!
Is there any way to when the User move the video forward or there is some buffer in a video, both videos still together?

I read in the forum about the possibility of the videos via java script checking the position of each other avoiding the loss of sync! How do? Any idea?

Ethan Feldman

JW Player Support Agent  
0 rated :

You could probably do this using our API.

JW Player

User  
0 rated :

Could you help me to do it ?

Ethan Feldman

JW Player Support Agent  
0 rated :

I don’t have an exact example of that, but here is one that uses our api to make it so only one player plays at a single time, and you can change it to do what you are trying to do:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <script type="text/javascript" src="http://player.longtailvideo.com/jwplayer.js"></script>
		<title>Multiple 2</title>
    </head>
	<body>
			<div id="container"></div>
			<script type="text/javascript">
			jwplayer("container").setup({
			file: "http://www.longtailvideo.com/jw/upload/bunny.mp4",
			image: "http://www.longtailvideo.com/jw/upload/bunny.jpg",
			flashplayer: "http://player.longtailvideo.com/player.swf",
			height: 200,
			width: 300,
			controlbar: "bottom",
			stretching: "exactfit",
			events:{
				onPlay: function() {
				jwplayer('container2').stop();jwplayer('container3').stop();
				}
			}
			});
			</script>
			<br />
			<div id="container2"></div>
			<script type="text/javascript">
			jwplayer("container2").setup({
			file: "http://www.longtailvideo.com/jw/upload/bunny.flv",
			image: "http://www.longtailvideo.com/jw/upload/bunny.jpg",
			flashplayer: "http://player.longtailvideo.com/player.swf",
			height: 200,
			width: 300,
			controlbar: "bottom",
			stretching: "exactfit",
			events:{
				onPlay: function() {
				jwplayer('container').stop();jwplayer('container3').stop();
				}
			}
			});
			</script>
			<br />
			<div id="container3"></div>
			<script type="text/javascript">
			jwplayer("container3").setup({
			file: "http://www.longtailvideo.com/jw/upload/bunny.mov",
			image: "http://www.longtailvideo.com/jw/upload/bunny.jpg",
			flashplayer: "http://player.longtailvideo.com/player.swf",
			height: 200,
			width: 300,
			controlbar: "bottom",
			stretching: "exactfit",
			events:{
				onPlay: function() {
				jwplayer('container').stop();jwplayer('container2').stop();
				}
			}
			});
			</script>
	</body>
</html>



http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/12540/javascript-api-reference

JW Player

User  
0 rated :

hi,

i would like to have one jw player to play a list of 5 videos . The same jw player should be used for playing any one of the 5 videos at a time.

i just tried using the playlist and unable to get the exact code to play the individual videos on the same jw player at a time.

thanks in advance

lucas

JW Player

User  
0 rated :



hi,

i would like to have one jw player to play a list of 5 videos . The same jw player should be used for playing any one of the 5 videos at a time.

i just tried using the playlist and unable to get the exact code to play the individual videos on the same jw player at a time.

Example:

List is like

1. Apple
2. Strawberry
3. Orange
4. Grapes
5. Pine Apple

Just clicking on any one of the above five option (link ), it should play the video on the single jwplayer present in the webpage.

I just struggled in finding a solution and hope to get help..

thanks in advance

lucas

Ethan Feldman

JW Player Support Agent  
0 rated :

Do you have a link?

JW Player

User  
0 rated :

hi ethan.... thanks ....

I found that my above request is same as per in this link but still i unfortunately unable to get it working and i have gone through jwplayer documentation a lot. I would be happy if you help me in this.

http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/16025/loading-new-content-into-the-player/

The code i used is as below and the browser i checked is firefox 18 and chrome Version 24.0.1312.52 m

<head>
<script type="text/javascript" src="/jwplayer/jwplayer.js"></script>
</head>
<div id="container">Loading the player ...</div>
<script type="text/javascript">
jwplayer("container").setup({
flashplayer: "/jwplayer/jwplayer.flash.swf",
file: "/mon.mp4",
height: 270,
width: 480
});
</script>
<ul>
<li onclick="jwplayer().play()">Start the player</li>
<li onclick="alert(jwplayer().getPosition())">Get current position</li>
<li><a href="#" onclick="jwplayer().load({file: "/tues.flv", image:"/tues.jpg"})">Load the tues trailer</a></li>
</ul>

Thanks

JW Player

User  
0 rated :


Hi just adding to the above details

I downloaded the free jwplayer (jwplayer-free-6-1-2972 ) and only has the below files in the jwplayer folder mentioned in the above code.

jwplayer.js
jwplayer.html5.js
jwplayer.flash.swf


Thanks

JW Player

User  
0 rated :

oops , i failed to mentioned what hasn't worked in the code.

On clicking the third link href for loading the tues video, i was unable to get the video played.

Code used is

<head>
<script type="text/javascript" src="/jwplayer/jwplayer.js"></script>
</head>
<div id="container">Loading the player ...</div>
<script type="text/javascript">
jwplayer("container").setup({
flashplayer: "/jwplayer/jwplayer.flash.swf",
file: "/mon.mp4",
height: 270,
width: 480
});
</script>

Start the player
Get current position
<a href="#" onclick="jwplayer().load({file: "/tues.flv", image:"/tues.jpg"})">Load the tues trailer</a>


Thanks



Ethan Feldman

JW Player Support Agent  
0 rated :

Please provide a link.

JW Player

User  
0 rated :

Hey Ethan !

I need a little help again!

Im still trying to make a sync player....

I use your code and create 2 events ... getPosition() and seek(position)..

but I cant found a way to this process be contnuos ....

Any Ideia ?

Ethan Feldman

JW Player Support Agent  
0 rated :

Link?

JW Player

User  
0 rated :

Ethan

http://www.onlineconcursos.com.br/novaonline/index.php?option=com_content&view=article&layout=edit&id=28

bc.. <head>
<script type="text/javascript" src="http://player.longtailvideo.com/jwplayer.js"></script>
<title>Multiple 2</title>
</head>
<body>
<div id="container"></div>
<script type="text/javascript">
jwplayer("container").setup({
file: "http://www.longtailvideo.com/jw/upload/bunny.mp4",
image: "http://www.longtailvideo.com/jw/upload/bunny.jpg",
flashplayer: "http://player.longtailvideo.com/player.swf",
height: 200,
width: 300,
controlbar: "bottom",
stretching: "exactfit",
events:{

onTime: function(eventa, eventb, Eventc) {
jwplayer('container2').Seek(eventa);
}

}
});
</script>
<br />
<div id="container2"></div>
<script type="text/javascript">
jwplayer("container2").setup({
file: "http://www.longtailvideo.com/jw/upload/bunny.flv",
image: "http://www.longtailvideo.com/jw/upload/bunny.jpg",
flashplayer: "http://player.longtailvideo.com/player.swf",
height: 200,
width: 300,
controlbar: "bottom",
stretching: "exactfit",
});
</script>
<br />


Ethan Feldman

JW Player Support Agent  
0 rated :

This link is behind a log in, please advise.

JW Player

User  
0 rated :

Please Try again!

I fixed it =]

Ethan Feldman

JW Player Support Agent  
0 rated :

Both of these players play fine? What are you trying to do here?

JW Player

User  
0 rated :

Im trying to sync then!

When I change a position on the first its happen on second too...

But I want to it every 60 seconds

Ethan Feldman

JW Player Support Agent  
0 rated :

What do you mean, play the first, then the 2nd one plays as well?

JW Player

User  
0 rated :

I want to use 2 players synchronously. When I trigger the play in one, both run together!
Is there any way to when the User move the video forward or there is some buffer in a video, both videos still together?

Ethan Feldman

JW Player Support Agent  
0 rated :

Here is a very basic example of 3 that will play at the same time:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <script type="text/javascript" src="http://player.longtailvideo.com/jwplayer.js"></script>
		<title>Multiple 2</title>
    </head>
	<body>
			<div id="container"></div>
			<script type="text/javascript">
			jwplayer("container").setup({
			file: "http://www.longtailvideo.com/jw/upload/bunny.mp4",
			image: "http://www.longtailvideo.com/jw/upload/bunny.jpg",
			flashplayer: "http://player.longtailvideo.com/player.swf",
			height: 200,
			width: 300,
			controlbar: "bottom",
			stretching: "exactfit",
			events:{
				onPlay: function() {
				jwplayer('container2').play();jwplayer('container3').play();
				}
			}
			});
			</script>
			<br />
			<div id="container2"></div>
			<script type="text/javascript">
			jwplayer("container2").setup({
			file: "http://www.longtailvideo.com/jw/upload/bunny.flv",
			image: "http://www.longtailvideo.com/jw/upload/bunny.jpg",
			flashplayer: "http://player.longtailvideo.com/player.swf",
			height: 200,
			width: 300,
			controlbar: "bottom",
			stretching: "exactfit",
			events:{
				onPlay: function() {
				jwplayer('container').play();jwplayer('container3').play();
				}
			}
			});
			</script>
			<br />
			<div id="container3"></div>
			<script type="text/javascript">
			jwplayer("container3").setup({
			file: "http://www.longtailvideo.com/jw/upload/bunny.mov",
			image: "http://www.longtailvideo.com/jw/upload/bunny.jpg",
			flashplayer: "http://player.longtailvideo.com/player.swf",
			height: 200,
			width: 300,
			controlbar: "bottom",
			stretching: "exactfit",
			events:{
				onPlay: function() {
				jwplayer('container').play();jwplayer('container2').play();
				}
			}
			});
			</script>
	</body>
</html>

JW Player

User  
0 rated :

I would like to play three jwplayers in sequence.
I.e play one by one.

I have three embed links.

Ethan Feldman

JW Player Support Agent  
0 rated :

I would just use a playlist for this. You could also set the 1st one to complete, play the 2nd one, then the 3rd one, etc.

This question has received the maximum number of answers.