Skip to content Skip to sidebar Skip to footer

Video Event On Given Second

Need to play the next video, when current video time reaches the given value, but don't know why the event that should get currentTime is not firing at all? Maybe someone has an id

Solution 1:

I would suggest changing the time check to a > rather than = because the currentTime event isn't an integrer

if (this.currentTime == videos[currentVideo-1][2]) {

becomes

if (this.currentTime > videos[currentVideo-1][2]) {

(or you could convert it to an integrer for the test)

If there are other issues it's worth adding a console.log(this.currentTime) to the event just to see if it's triggering the code


Post a Comment for "Video Event On Given Second"