Here is the site I'm working on: http://t3kno.dewpixel.net/
As you can see, there is a running list of songs (youtube videos of songs). I implemented the functionality, so as soon as one song is played, the next one on the list will automatically start playing.
I had a problem when the video I am trying to download was deleted by youtube for copyright content. I am currently checking the status of the song by calling:
player.getPlayerState()
And waiting for the return of state 0 (completed). As soon as the song ends, I will try to download the next song. As soon as this song loads, I call:
player.playVideo()
However, if this song was deleted, I had no luck. I want to try to find a way to catch this event and move on to the next song. However, when I try to play a song that has been deleted, there is no change in state. Value:
function onytplayerStateChange(newState) {
Never executed. How can I detect this event and handle it correctly?
Chawk source share