1 <video 2 id="video-active" 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 id="current">0:00</div> 10 <div id="duration">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 }