I have a HTML5 video element in my page. The video I want to play is having a duration of 10 minutes.
I have to play the part of the video from minute
So as below
using Above HTML attach an Event
var vid = document.getElementById("myVid"); vid.addEventListener("timeupdate", function(){ // Check you time here and if(t >= 300000) //Where t = CurrentTime { vid.stop();// Stop the Video } });
This is the right way of doing it.