1 <video
 2     
 3     class="video-active"
 4     width="640"
 5     height="390"
 6     controls="controls">
 7     <source src="myvideo.mp4" type="video/mp4">
 8 </video>
 9 <div >0:00</div>
10 <div >0:00</div>
11 
12 js代码
13 $(document).ready(function(){
14   $("#video-active").on(
15     "timeupdate", 
16     function(event){
17       onTrackedVideoFrame(this.currentTime, this.duration);
18     });
19 }
20 
21 function onTrackedVideoFrame(currentTime, duration){
22     $("#current").text(currentTime);
23     $("#duration").text(duration);
24 }

 


 
                    
            
                

相关文章:

猜你喜欢
相关资源
相似解决方案