I have an HTML5 video that plays on my site, I want to track the time of this video and perform its function or warning when the video lasts 10 seconds, 20 seconds, 30 seconds, etc. Am I fixated on how to do this? I can get it to warn every 10 seconds using jQuerys setInterval, but this is based on the jquerys time parameter and not the movie itself ... this is what I have
window.setInterval(function(){
var video = $('video#full-vid').get(0);
alert('video time:' + video.currentTime);
}, 10000);
Any ideas?
This is basically the logic:
- Get a video
- If 10 seconds of video transmission warning “10 seconds have passed”
- If there are 20 seconds of a “20 seconds have passed” video transmission warning, etc., etc.
thanks