我可以使用 <video>
吗?或 <audio>
标签来播放播放列表,并控制它们?
我的目标是知道视频/歌曲何时播放完毕,然后播放下一首并更改其音量。
最佳答案
你可以像那样在 onend 事件中加载下一个剪辑
<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 />
更多信息 here
关于javascript - HTML 5 视频或音频播放列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2551859/