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 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


JW Player Support Agent  
0 rated :


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">
<meta charset="UTF-8">
<script src=""></script>
display: none;
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: "", },{ file: "", },{ file: "", }], 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

0 rated :

oh thanks it works great

This question has received the maximum number of answers.