im trying to control an embedded stream player via javaScript. As basis I used the code from here: https://github.com/justintv/Twitch-API/blob/master/player.md with minimal changes (needed to add “http://” to the source-pathes, somehow)
But it seems like the eventsCallback function “onPlayerEvent” is never getting called.
Already tried to replace “eventsCallback” with “playerCallback” ( Twitch Player JS API: Broken initCallback? ) but this won’t do the trick as well.
In consequence there won’t be an instance of the player to control the stream with player.playVideo(), player.mute() etc.
How to make the script invoke the defined callback function?
Is there another way to get an instance of the twitch player to use the functions player.playVideo(), player.mute()…?
it’s pretty much copy&pasted from the player.md documentation…
To show what I mean I added some console log calls.
When the file is opened in Firefox, the player loads, the stream starts and i see the control log output “LOG: test”. But thats it. No more console log outputs. (and the stream doesn’t get muted, too)
Thats why I came to the conclusion that the function “onPlayerEvent” never gets called. Maybe I missunderstand the code and it’s fine that the function isn’t called - then I would be happy about a little explanation about how the callback actually works.
but this still doesn’t change anything about the fact (at least in my case) that the script never jumps into the onPlayerEvent function/section so this line is actually never reached.
Yeap, apparently player.md disappeared from the face of the earth, and the old .swf that’s still up is broken now somehow ( loadStream(); doesn’t work anymore ) and it doesn’t look like someone’s going to fix it. I’m migrating all my current projects to the new html5 player (embed-video.md), as much of a pain in the ass that may be…