<!-- This is a test html file for video test. --> | |
<html> | |
<body> | |
<video id='testvideo' controls autoplay name='media'> | |
<source src='video.mp4' type='video/mp4'> | |
</video> | |
<br> | |
Current time (seconds): <span id='videoCurTime'>0</span> | |
</body> | |
<script type="text/javascript"> | |
(function() { | |
var timeEle = document.getElementById('videoCurTime'); | |
testvideo.addEventListener('timeupdate', function(event) { | |
timeEle.innerHTML = testvideo.currentTime; | |
}, false); | |
})(); | |
</script> | |
</html> |