0

I am just trying to trigger an alert('test') at the end of a youtube video, worked well until today.

I just made a jsfiddle http://jsfiddle.net/264BB/, if anyone can check the code or faced the same issue please let me know, it would be nice.

function onPlayerStateChange(event) {
    alert('test')
    if (event.data == YT.PlayerState.ENDED) {
        alert('test')
    }
}

If the trigger works well notice me too, maybe it is a browser specific problem.

Cœur
  • 37,241
  • 25
  • 195
  • 267
knotito
  • 1,382
  • 1
  • 12
  • 18
  • this appears to be an issue only when YT is using the "default player", not HTML5. If I go to https://www.youtube.com/html5 and "Request the HTML5 player" on Firefox, I will start receiving events again. But of course I can't tell all of my users to do that. – knotito Jul 31 '14 at 16:47

1 Answers1

1

YouTube API OnStateChange Listener Stops Working After Switch SRC Attr

You should check there, the guys is using the same API and code and it looks good. Hope it will help you.

Community
  • 1
  • 1
Nicolas Le Bot
  • 324
  • 5
  • 15