Can you give me an example for Chrome where I have something like this:
function checkVideoStatus(vidElement){
var currentTime = vidElement.currentTime;
//now wait 5 seconds
var updatedTime = vidElement.currentTime;
//now check if video has freezed
if(updatedTime == currentTime){
//fire videoFreeze Event
}
}
So I would want to fire this event here. Also, is it really necessary to fire this event, since I already can put a relevant method call here to do what I want accordingly?
Is it in JS the events are only like onChange, onMouseOver etc?
This is a simple mockup of a custom event and a countdown.
http://jsfiddle.net/userdude/Ampbm/1
This is mostly to show how to make a custom event which fires after five seconds. I’m also using the
data-attribute to store the current time. What you’re doing in theifblock I’m not quite sure about, since.updatedTimeand.currentTimeseems to me to be possibly the same thing each go round.