视频连续播放
我目前有这个:
Javascript
<script>
$('document').ready(function(){
$('video').get(0).play();
// $('video').bind('ended', function(){
// $(this).next('video');
// });
$('video').each(function(val, index){
$(this).bind('ended', function(){
$(this).get(index + 1).play();
});
});
});
</script>
HTML
<video width="703" height="704" controls preload="auto" src="LOW.mp4">Video format not supported.</video>
<h3>CBS - m4v</h3>
<video width="703" height="704" controls preload="auto" src="1100.m4v">Video format not supported.</video>
<h3>Video #3</h3>
<video width="703" height="704" controls preload="auto" src="yep.mp4">Video format not supported.</video>
现在,javascript 不起作用。如何在第一个视频结束后立即播放下一个视频,然后在第二个视频结束后播放第三个视频。并不总是 3 个视频,可以有更多。
I currently have this:
Javascript
<script>
$('document').ready(function(){
$('video').get(0).play();
// $('video').bind('ended', function(){
// $(this).next('video');
// });
$('video').each(function(val, index){
$(this).bind('ended', function(){
$(this).get(index + 1).play();
});
});
});
</script>
HTML
<video width="703" height="704" controls preload="auto" src="LOW.mp4">Video format not supported.</video>
<h3>CBS - m4v</h3>
<video width="703" height="704" controls preload="auto" src="1100.m4v">Video format not supported.</video>
<h3>Video #3</h3>
<video width="703" height="704" controls preload="auto" src="yep.mp4">Video format not supported.</video>
Right now, the javascript isn't working. How do I play the next video as soon as the first video finishes and then play the third one once the second one finishes. There aren't always 3 videos, there coudld be more.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的脚本中有两个小错误,以下代码未经测试,但应该可以工作:
以下是您的一些错误:
You have two small errors in your script the following code is untested, but should work:
Here are some of your error: