I want to pause a video that is playing from inside an if statement in a funciton. it doesnt pause it till after every thing in the if has completed. if I move the pause outside the if , it does stop. I tried just about everything i can think of. an anyone explain to me why this is not working. and or provide a sample of working code?
function checktimeout()
{
seconds =seconds -1
//video = document.getElementById('thisvideo');
//video.pause()
if (seconds == 0)
{
video = document.getElementById('thisvideo');
video.pause()
//do some other stuff here
}
}
seconds = 5
delaytimer = setInterval(checktimeout,1000);
Aucun commentaire:
Enregistrer un commentaire