视频播放完调用播放接口播放不需要点击按钮
显示按钮document.getElementById('next').style.display='block'

解决方案 »

  1.   

    现在如何判断视频已经播放完
    http://www.w3school.com.cn/tags/html_ref_audio_video_dom.asp
      

  2.   

    现在如何判断视频已经播放完
    http://www.w3school.com.cn/tags/html_ref_audio_video_dom.asp
    我刚也去看了,发现了里面有个ended的属性,他那个例子不是有一个button来判断他是否已经结束嘛?
    现在我开始的页面没有任何button,怎么来触发判断这个ended
      

  3.   

    http://msdn.microsoft.com/zh-cn/library/ff974154(v=vs.85).aspx
    http://blog.csdn.net/zengconggen/article/details/8071949
      

  4.   

    加个定时器没100MS检测下视频的ended属性,如果true则取消定时器并执行你的代码。
      

  5.   


    <p align="center">
                   <video id="video1" width="800" height="600" autoplay="autoplay" >
                   <source src="TestVideo.mp4"  type="video/ogg"  ></video></p><script type="text/javascript">
    myVid=document.getElementById("video1");
    function hasVidEnded()
      { 
        if (myVid.ended == false)
        { document.getElementById("button1").style.display="none"}
    else{document.getElementById("button1").style.display="block"}
       
      
      } 
    </script>    <div align="center">
       <input id="button1" input type="button" name="Submit" style="display:none;background:SlateGray;color:WhiteSmoke;width:85px;height:40px;" value="下一页" onclick="window.location.href='t2.html'">
       </div>
    这是我部分代码,真的被这个搞头疼了,刚开始接触都是边做边学
      

  6.   

    我就是开始页面让video自动播放,当播放完毕后那个下一页按钮才出来,用户才能点击跳转
      

  7.   


    <p align="center">
                   <video id="video1" width="800" height="600" autoplay="autoplay" >
                   <source src="TestVideo.mp4"  type="video/ogg"  ></video></p><script type="text/javascript">
    myVid=document.getElementById("video1");
    function hasVidEnded()
      { 
        if (myVid.ended == false)
        { document.getElementById("button1").style.display="none"}
    else{document.getElementById("button1").style.display="block"}
       
      
      } 
    </script>    <div align="center">
       <input id="button1" input type="button" name="Submit" style="display:none;background:SlateGray;color:WhiteSmoke;width:85px;height:40px;" value="下一页" onclick="window.location.href='t2.html'">
       </div>
    这是我部分代码,真的被这个搞头疼了,刚开始接触都是边做边学
    document.getElementById('video1').onended=function(){alert(2)}
      

  8.   


    <p align="center">
                   <video id="video1" width="800" height="600" autoplay="autoplay" >
                   <source src="TestVideo.mp4"  type="video/ogg"  ></video></p><script type="text/javascript">
    myVid=document.getElementById("video1");
    function hasVidEnded()
      { 
        if (myVid.ended == false)
        { document.getElementById("button1").style.display="none"}
    else{document.getElementById("button1").style.display="block"}
       
      
      } 
    </script>    <div align="center">
       <input id="button1" input type="button" name="Submit" style="display:none;background:SlateGray;color:WhiteSmoke;width:85px;height:40px;" value="下一页" onclick="window.location.href='t2.html'">
       </div>
    这是我部分代码,真的被这个搞头疼了,刚开始接触都是边做边学
    document.getElementById('video1').onended=function(){alert(2)}<video id="video1" width="800" height="600" autoplay="autoplay" >
                   <source src="TestVideo.mp4"  type="video/ogg"  ></video></p><script type="text/javascript">
    document.getElementById("video1").addEventListener("onended",function () {
        document.getElementById("button1").style.display="block"},true)
    </script>
        <div align="center">
       <input id="button1" input type="button" name="Submit" style="display:none;background:SlateGray;color:WhiteSmoke;width:85px;height:40px;" value="下一页" onclick="window.location.href='t2.html'">
       </div>
    这样嘛