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

Playlists for both RTMP and progressive MP4 streaming ?


I cannot find any information regarding how to set this up in the JWplayer documentation.
I have 10 videos and serve them in RTMP and progressive MP4.

bc.. var player = jwplayer("container").setup({
playlist: [{
image: "my_image.jpg",
sources: [{
file: "rtmp://myserver.com/mp4:clips/video001.mp4?audioIndex=0"
},{
file: "http://myserver.com:1935/somepath/mp4:clips/video001.mp4/playlist.m3u8?audioIndex=0"
}]
}],



So with the above code basically I need to add 9 more videos for both RTMP and progressive.

What is the way to do this?

13 Community Answers

JW Player

User  
0 rated :

Your playlist (Array) currently contains a single media item (JavaScript Object). Simply add more Objects to this Array to build a playlist of multiple items:

bc.. var player = jwplayer("container").setup({
playlist: [
{
image: "my_image.jpg",
sources: [{
file: "rtmp://myserver.com/mp4:clips/video001.mp4?audioIndex=0"
},{
file: "http://myserver.com:1935/somepath/mp4:clips/video001.mp4/playlist.m3u8?audioIndex=0"
}]
}
,
{
image: "my_image_2.jpg",
sources: [{
file: "rtmp://myserver.com/mp4:clips/video002.mp4?audioIndex=0"
},{
file: "http://myserver.com:1935/somepath/mp4:clips/video002.mp4/playlist.m3u8?audioIndex=0"
}]
}
,
{
image: "my_image_x.jpg",
sources: [{
file: "rtmp://myserver.com/mp4:clips/video00x.mp4?audioIndex=0"
},{
file: "http://myserver.com:1935/somepath/mp4:clips/video00x.mp4/playlist.m3u8?audioIndex=0"
}]
}
],
...

JW Player

User  
0 rated :

Thank you very much!

JW Player

User  
0 rated :

last question

how can I add sharing to each of those individual videos in the playlist?

Ethan Feldman

JW Player Support Agent  
0 rated :

Basic sample of fallbacks – http://www.longtailvideo.com/support/jw-player/29394/hls-with-mp4-fallback

Ethan Feldman

JW Player Support Agent  
0 rated :

Sharing is just an overall configuration option for the player – http://www.longtailvideo.com/support/jw-player/28857/social-sharing-options

JW Player

User  
0 rated :

So I've added
bc.. mediaid: "<?= $episode_link;?>"

to each of the video arrays
and then
bc.. sharing: {
link: "MEDIAID"
}

the mediaid gets filled with the full path to the video but the problem is when the user clicks share the url is taking the relative path of where the player is playing instead of using the mediaid variable...

any ideas?

here's full code for reference
bc.. var player = jwplayer("container").setup({
playlist: [

<?php
for($i = 0; $i < count($episode_details->playlist); $i++ )
{
?>
{
image: "<?= $poster; ?>",
sources: [{
file: "rtmp://server.com/video/mp4:<?= $episode_details->playlist[$i]; ?>?audioIndex=" + defaultLangIndex,
mediaid: "<?= $episode_link;?>"
},{
file: "http://server.com:1935/video/mp4:<?= $episode_details->playlist[$i]; ?>/playlist.m3u8?audioIndex=" + defaultLangIndex,
mediaid: "<?= $episode_link;?>"
}]
}
<?php
echo ($i < count( $episode_details->playlist) ) ? ',' : '';
}
?>
],
sharing: {
link: "MEDIAID"
},
ga: {},
skin: "bekle",
wmode: "opaque",
height: 360,
width: 480,
});

JW Player

User  
0 rated :

we have premium jwplayer so it should work, I guess I have something wrong in the above code?

Ethan Feldman

JW Player Support Agent  
0 rated :

Where is this running?

JW Player

User  
0 rated :

what do you mean?

JW Player

User  
0 rated :

is there a way I can send you the link in private?

Ethan Feldman

JW Player Support Agent  
0 rated :

http://www.jwplayer.com/contact-us/

JW Player

User  
0 rated :

ok done, I put a note in the message saying its for you and what the issue is

thanks

Ethan Feldman

JW Player Support Agent  
0 rated :

Np

This question has received the maximum number of answers.