Twitch.Player.READY fires prematurely

Hi All,
I think the Twitch.Player.READY event is fired prematurely (before it is actually ready to receive function calls) by the embed player.

My code looks like:

poc.player = new Twitch.Player(poc.VOD_CONTAINER_ID, poc.PLAYER_OPTIONS);

// Add event listener waiting for the player to be ready
poc.player.addEventListener(Twitch.Player.READY, poc.onReady);

and onReady contains:

console.log("poc.onReady");

// Do something to the player
poc.player.setVolume(0.5);
poc.player.setMuted(true);

The console log message works, but neither of the function calls to the player do anything, so it appears that the player wasn’t ready to receive them?

Documentation for this is at https://dev.twitch.tv/docs/v5/guides/embed-video/#events-emitted-by-and-defined-by-the-player

Is this a bug, or are the docs out of date?
I have found a similar (the same?) issue on the old github issue tracker: https://github.com/justintv/Twitch-API/issues/514

Any help would be appreciated.
Many thanks,
Josh

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.