Cmasterd
Cmasterd

Reputation: 189

Want to track when a video is (25%, 50%, 75%) complete?

Hey I use a custom built Html5 video player, I just wanted to know if I can track when the video has reached 25%, 50% and 75% complete. I was thinking of tracking the length(time) of the video and when it gets to the 3 key stages send an alert for testing purposes. So my question really would be is this the way to go or is there a better way to track if a html video has played 25%, 50% and 75% of the way through?

Upvotes: 0

Views: 836

Answers (1)

benjamin.d
benjamin.d

Reputation: 2871

Since you are using HTML5 video capabilities, you could give a try to the timeUpdate event on media elements. Using jQuery:

$("#video").bind("timeUpdate", function() {
   ....
});

The W3C documentation is available here.

Upvotes: 2

Related Questions