Embedding
Events
Player Events

Start listen events

const player = new TwitchPlayer(
    'twitch-player', 
    options: {
        width: '1280',
        height: '720',
        video: '2064229582',
        parent: ['anivire.xyz']
    });
 
player.addEventListener(TwitchPlayerEvents.READY, () => {
    console.info('Player is ready to accept function calls.')
});

CAPTIONS: Closed captions are found in the video content being played. This event will be emitted once for each new batch of captions, in sync with the corresponding video content. The event payload is a string containing the caption content,

ENDED: Video or stream ends,

PAUSE: Player is paused. Buffering and seeking is not considered paused,

PLAY: Player just unpaused, will either start video playback or start buffering,

PLAYBACK_BLOCKED: Player playback was blocked. Usually fired after an unmuted autoplay or unmuted programmatic call on play(),

PLAYING: Player started video playback,

OFFLINE: Loaded channel goes offline,

ONLINE: Loaded channel goes online,

READY: Player is ready to accept function calls,

SEEK: User has used the player controls to seek a VOD, the seek() method has been called, or live playback has seeked to sync up after being paused