Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
147
rated 0 times [  148] [ 1]  / answers: 1 / hits: 147333  / 15 Years ago, wed, march 31, 2010, 12:00:00

Can I use a <video> or <audio> tag to play a playlist, and to control them?



My goal is to know when a video/song has finished to play and take the next and change its volume.


More From » html

 Answers
84

you could load next clip in the onend event like that



<script type=text/javascript>
var nextVideo = path/of/next/video.mp4;
var videoPlayer = document.getElementById('videoPlayer');
videoPlayer.onended = function(){
videoPlayer.src = nextVideo;
}
</script>
<video id=videoPlayer src=path/of/current/video.mp4 autoplay autobuffer controls />


More information here


[#97199] Saturday, March 27, 2010, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
kennedim

Total Points: 699
Total Questions: 85
Total Answers: 105

Location: Saint Helena
Member since Mon, Jan 16, 2023
1 Year ago
;