How to get the the seek time while on video playing in javascript

Viewed 3525

I'm trying to get the seek time while on video playing. I use the play event it is triggered only video start.

HTML:

<video controls id="videoFile">
   <source src="Why Linux over Windows 3D Animation.mp4" id="video_here"> 
</video>

Javasript:

var secondvideo = document.getElementById('videoFile');
secondvideo.addEventListener('play', function(e) { 
    // The video is playing
    console.log("current time= "+ document.getElementById('videoFile').currentTime);

});
2 Answers
Related