1 <!-- This is a test html file for video test. --> 2 <html> 3 <body> 4 <video id='testvideo' controls autoplay name='media'> 5 <source src='video.mp4' type='video/mp4'> 6 </video> 7 <br> 8 Current time (seconds): <span id='videoCurTime'>0</span> 9 </body> 10 11 <script type="text/javascript"> 12 (function() { 13 var timeEle = document.getElementById('videoCurTime'); 14 testvideo.addEventListener('timeupdate', function(event) { 15 timeEle.innerHTML = testvideo.currentTime; 16 }, false); 17 })(); 18 </script> 19 </html> 20