xdevel2000 xdevel2000 - 4 months ago 15
HTML Question

HTML 5 video or audio playlist

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.

Answer

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