Skip to content

PlayerEvent

Copy as Markdown

What a player’s listener is given.

player.on("statechange", (event) => console.log(event.state, event.player.time));
player.on("error", (event) => reportToMonitoring(event.error));

S extends string = string

readonly optional error?: unknown

error only: what was thrown inside the player.


readonly optional fatal?: true

error only: always true, the player went inert.


readonly player: Player<S>

The player that sends it.


readonly state: S | null

The state that plays once the event is sent (player.state).


readonly type: PlayerEventType

The event’s type.