Da, problem je u funkciji onYouTubePlayerStateChange.
https://developers.google.com/youtub...#onStateChange
Citat:
onStateChange
This event is fired whenever the player's state changes. Possible values are unstarted (-1), ended (0), playing (1), paused (2), buffering (3), video cued (5). When the SWF is first loaded it will broadcast an unstarted (-1) event. When the video is cued and ready to play it will broadcast a video cued event (5).
|
Pri učitavanju videa menja se stanje tako da se uništava timer i ponovo pokreće, stalno prelazi iz stanja 1 u stanje 3, pokušaj da rešiš to drugačije, možda nešto pomoću getCurrentTime kao što sam predložio u ovoj temi ili da ne uništavaš timer prilikom promene stanja.