PlayerEvent
Copy as MarkdownWhat a player’s listener is given.
Example
Section titled “Example”player.on("statechange", (event) => console.log(event.state, event.player.time));player.on("error", (event) => reportToMonitoring(event.error));Type Parameters
Section titled “Type Parameters”S extends string = string
Properties
Section titled “Properties”error?
Section titled “error?”
readonlyoptionalerror?:unknown
error only: what was thrown inside the player.
fatal?
Section titled “fatal?”
readonlyoptionalfatal?:true
error only: always true, the player went inert.
player
Section titled “player”
readonlyplayer:Player<S>
The player that sends it.
readonlystate:S|null
The state that plays once the event is sent (player.state).
readonlytype:PlayerEventType
The event’s type.