Edit:
I have managed to set up the eventsCallback properly. However the only events called are playerInit, videoLoaded and videoPlaying. There are no events triggered for play/pause/ended/etc. Is there something I am missing or is this simply not implemented?
I really need to figure out when a vod has ended. I just tried testing if isPaused() == true when the video has ended, but it is false.
I was toying with the idea of using an incrementing number and comparing it with vod length, but this doesn’t work if you seek and I doubt it works if there is buffering.
There is a method called getVideoTime(), which I assume you could test for in relation to vod length?
There are several undocumented methods regarding the player. It is unclear if this is intended or not.
I’m setting the event listeners in js in my UIWebview for online,offline,ended,pause,and play.
I don’t get events fired for when the broadcaster comes online/offline or ended when they end the stream, but I do get events for pause and play.
Does online/offline/ended work?
Since the old player was removed from Twitch’s API documentation and is now unsupported, it might be broken. Twitch only offers their new HTML5 iframe player, which does not yet have a public API. To get notification when the channel goes online or offline, you may need to resort to polling Twitch’s API.