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

how make a playlist with 2 or more live steaming and change between streamings


i i wanna make a player with 2 or more sources but all are live streaming like this content http://holapuertovallarta.com/webcam/streaming.html that will be one of them and we got 2 more of that still local so ....

wherever i wanna make a player displaying three of that videos how can i do that start playing one and after 5 minutes stop and load the next one

2 Community Answers

George

JW Player Support Agent  
0 rated :

Hi,

I wrote this test code for you. I am switching every 7 seconds but you could make that 300 seconds

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<script src="http://content.jwplatform.com/libraries/OEp1hUBd.js"></script>
<style>
.jw-icon-next{
display: none;
}
.jw-icon-prev{
display: none;
}

</style> </head> <body> <div id="container">Loading Video…</div> <script> var hasStarted=false; var lastCurrentTime=0; var playerone = jwplayer("container"); playerone.setup({ playlist: [{ file: "http://162.244.81.194:1935/live/SistemaS2506/playlist.m3u8", },{ file: "http://content.jwplatform.com/manifests/nJEIV3eJ.m3u8", },{ file: "http://content.jwplatform.com/manifests/PxnoM5gE.m3u8", }], width:"80%", aspectratio:"16:9", visualplaylist:false, // controls:false, autostart:true }); playerone.on("time",function(event){ // Change Text To Spanish if(!hasStarted){ document.getElementsByClassName("jw-text-alt")[0].innerHTML="transmisión en vivo"; hasStarted=true; } // get current time, this fires 15 times a second var currentTime = Math.round(event.position); // setup lastcurrent time to get it to fire once a second if(currentTime!=lastCurrentTime){ lastCurrentTime=currentTime; console.log(lastCurrentTime+" time running"); } // every 7 seconds switch playlist item if(lastCurrentTime==7){ var playlistSize = playerone.getPlaylist().length; var currentItem = playerone.getPlaylistIndex()+1; playerone.playlistItem(currentItem%playlistSize); console.log(currentItem%playlistSize+" item"); } }); </script></body> </html>

sistemas N/A

User  
0 rated :

oh thanks it works great

This question has received the maximum number of answers.