Events

With js3q you can listen to all player events or to specific kind of events.

EventListener

// Listen to all events
player.on('*.*', function (data) {
    console.log('js3q::' + this.event + ' ' + JSON.stringify(data));
});

// Listen to all media events
player.on('media.*', function (data) {
    console.log('js3q::' + this.event + ' ' + JSON.stringify(data));
});

// Listen to a specific event only once
player.once('media.ready', function (data) {
    console.log('js3q::' + this.event + ' ' + JSON.stringify(data));
});

Available events

Player Events

EventDescription

player.fullscreenChange

Is called when the player enters/leave fullscreen.

player.controllbarChange

player.playRequest

Is called when the user requests playback.

player.pauseRequest

player.seekRequest

Configuration Events

EventDescription

configuration.loaded

configuration.loadError

The configuration is not loaded due to an error. statuscode is provided.

Media Events

EventDescription

media.loading

media.ready

media.autoplayfailed

Autoplay failed (user gesture required)

media.autoplaymuted

If allowmutedautoplay is configured, the player try to start the video muted.

media.playing

media.paused

media.muted

media.unmuted

media.complete

media.seeking

media.seeked

media.volumeChange

media.timeChange

media.durationChange

media.subtitleChange

media.audioChange

Ad Events

EventDescription

ads.initEvent

ads.adsLoadError

ads.adPlaying

An ad starts playing.

ads.adPlaying

ads.adPaused

ads.skipped

ads.adComplete

ads.contentPauseRequest

ads.contentResumeRequest

ads.completeEvent

Casting

EventDescription

cast.started

cast.stopped

CtA

EventDescription

cta.displaying

cta.closed

Last updated