const embed = new Twitch.Embed(`twitch-embed`, {
width: 300,
height: 500,
channel: user
});
embed.addEventListener(Twitch.Embed.VIDEO_READY, () => {
const player = embed.getPlayer();
player.addEventListener(Twitch.Player.PLAY, () => {
console.log("HERE");
});
player.setQuality('160p30');
player.setMuted(true);
});
I am unable to addEventLsitener to an embeds PLAYER as it is undefined.
API Reference claims that "To provide additional functionality to our API, access specific components with getPlayer()
, which retrieves the current video player instance from the Embed, and provides full programmatic access to the video player API. Here
Related Thread: Internal
Sorry if this has been solved elsewhere, I was unable to find answers or resources to answer this.
Thanks