首页 > Web开发 > 详细

js获取video的播放时长

时间:2018-07-09 17:44:00      阅读:654      评论:0      收藏:0      [点我收藏+]
 
 1 setTimeout(function () {
 2               var vid = document.getElementById("videoIntro");
 3               var currentTime=vid.currentTime.toFixed(1);
 4               if(currentTime==1.2){
 5                   //触发
 6                   return false;
 7               }
 8               console.log(currentTime);
 9               getvideoprogress();
10           }, 1000);
11   function getvideoprogress() {
12     setTimeout(function () {
13               var vid = document.getElementById("videoIntro");
14               var currentTime=vid.currentTime.toFixed(1);
15               if(currentTime==1.2){
16                   //触发
17                   return false;
18               }
19               console.log(currentTime);
20               getvideoprogress();
21           }, 1000);
22   }

 

js获取video的播放时长

原文:https://www.cnblogs.com/chenlove/p/9284818.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!