There is no easy way to track an event using api only.
That you can use the javascript function in the interval and check if the time difference is different from the expected
Here is a sample code:
<html> <body> <div id="player"></div> <script> var tag = document.createElement('script'); tag.src = "https://www.youtube.com/iframe_api"; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); var player; function onYouTubeIframeAPIReady() { console.log("ready"); player = new YT.Player('player', { height: '390', width: '640', videoId: 'cRmNPE0HwE8', events: { 'onReady': onPlayerReady, 'onStateChange': onPlayerStateChange } }); </script> </body> </html>
source share