Ontimeupdate with YouTube API

HTML5 video supports the event ontimeupdate; is there an equivalent in the YouTube API that is either not listed in the docs, or just I don’t know I tried the setInterval method to check every n milliseconds, but then I have to check if the video is playing, etc. Has anyone dealt with this problem?

+5
source share
1 answer

You should be able to bind an event handler to onStateChange and verify that the state is 1 (play), which is the same as I can see as ontimeupdate. https://developers.google.com/youtube/js_api_reference#Events (scroll a bit up for the eventListener binding function)

0

All Articles