Events

You can monitor the player events using the player.on() method. The player also supports all HTMLMediaElement events. For details, refer to the MDN documentation.


The following table provides a description of each player event and its purpose:

NameDataTrigger Event Description
audiotrackswitchednullThe player changes audio tracks.
handle-play-clickednullThe play button is clicked.
theaterchangingnullTheater mode is changed.
fullscreenchangingbooleanFull-screen mode is changing (before the change completes).
fullscreenchangedbooleanFull-screen mode change completed.
toclangstringCue points language changes.
cclangstringCaptions language changes.
annotationslangstringAnnotations language changes.
qualitychangestringThe quality level changes (automatic or manual).
manualqualitystringThe quality level is manually changed by the user.
resizeplayer{ width, height, outerWidth }The player size changes.
prevtracknullSwitching to the previous track in the playlist.
nexttracknullSwitching to the next track in the playlist.
mobiletouchnullMobile touch events.
downloadRequested(url: string, callback: function)The player returns the download URL and callback per the user's request to download the media.
statechanged(state: PlayerState, old: PlayerState)The player state changes. Emits both the new state and the previous state.
cclayoutchange{ mode, fontSize }The closed captions layout changes.
captionschangePlayerTimeDataSourceThe captions change.
changeplaylistmodebottom / rightThe player playlist mode changes.
changesourcePlayerSourceThe current media source changes.