JQuery如何在上一个视频结束时自动加载下一个视频?

时间:2013-08-25 00:17:53

标签: jquery video youtube

我有这个视频列表

watch?v=IcrbM1l_BoI
watch?v=t2hlcavdwrQ
watch?v=lDK9QqIzhwk

我希望这些视频能够在全屏播放并自动加载下一个视频而不退出全屏(如9gag.tv)任何想法?我附上了我的代码

<script type='text/javascript'>//<![CDATA[ 
$(window).load(function(){
$(document).ready(function(){

$('.buton_video').click( function(e){
e.preventDefault();
var URL = $(this).attr('href');
var htm = '<iframe width="738" height="450" src="http://www.youtube.com/embed/' + URL + '?wmode=transparent&rel=0&theme=light&color=white&autoplay=1" frameborder="0" allowfullscreen ></iframe>';

$('#video_div').html(htm);

return false;
});
});
});//]]>  

</script>


  <a href="IcrbM1l_BoI" class="buton_video">Avicii - Wake me up</a><br/>
<a href="t2hlcavdwrQ" class="buton_video">Ahmed Chawki feat Pitbull - HABIBI I Love You</a><br/>
<a href="lDK9QqIzhwk" class="buton_video">Bon Jovi - Livin' On A Prayer</a><br/>



<div id="video_div">
<iframe width="738" height="450" src="http://www.youtube.com/embed/IcrbM1l_BoI?wmode=transparent&rel=0&theme=light&color=white&autoplay=1" frameborder="0" allowfullscreen ></iframe>
</div>

有任何帮助吗?谢谢!

0 个答案:

没有答案