Web SDK - Player events


Player Event sequence


The above image highlights the event sequence triggered by a Player visible after scrolling with the autoStart value set to firstTimeViewable and serving a pre-roll advertisement. The event sequence may change depending on the configuration and integration of the Player.




Initialize Player (web)

PLAYER_CRITICALPATHREADY

Sent every time a video is ready to play, or started playing (depending on autoplay settings, and their resolution by the browser), or is unable to play (blocked, restricted, unavailable).

Listen to this event if you want to defer doing network-heavy and JavaScript-heavy work, to allow the optimal delivery of the first frames of the video to the used.


Load content (web)

VIDEO_PROGRESS

Sent when the browser is fetching the media data.

PLAYER_VIDEOCHANGE

Sent when a new video has been loaded in the player. (e.g. after calling loadContent({ video: 'xID' }), or at player start-up).

PLAYER_RECODISPLAY

Sent each time a recommended video thumbnail (from either automatic recommendation, custom recommendation or contextual recommendation) is displayed for the first time in the Player carousels.

VIDEO_DURATIONCHANGE

Sent when the duration property of the video becomes available or changes after a new video load.


Picture-in-picture (web)

PLAYER_PIPEXPANDEDCHANGE

Sent when the Picture-in-Picture expanded mode changes, only on small viewports.

PLAYER_PRESENTATIONMODECHANGE

Sent when the player transitions to or from a Picture-in-Picture state, either native or the dailymotion version, or when the player enters or exits the fullscreen state.


Viewability (web)

PLAYER_VIEWABILITYCHANGE

Sent when the Player viewability values changes (50% of the Player is within the user’s viewport).


Advertising (web)

AD_COMPANIONSREADY

Sent when a companion ad is received. Companion ads should be played in sync with the main ad (linear/non-linear) by listening to events AD_START and AD_END.

AD_DURATIONCHANGE

Sent when the duration property of the video advertisement becomes available or changes after a new video load.

AD_END

Sent when the player completes playback of an ad.

AD_IMPRESSION

Sent when the first ad frame is displayed.

AD_LOADED

Sent when the player has loaded and buffered the creative’s media and assets either fully or to the extent that it is ready to play the media.

AD_PAUSE

Sent when the player pauses an ad.

AD_PLAY

Sent when the ad playback starts or continues after being in a paused state.

AD_READYTOFETCH

Sent 6 seconds before an ad request is made. The request delay can be customized.

AD_START

Sent when the player begins playback of an ad video.

AD_TIMECHANGE

Sent when the playback position of an ad changes.

AD_CLICK

Sent when a user clicks on a video ad.


Playback (web)

PLAYER_START

Sent the first time the player attempts to start the playback, either because of user interaction, an autoplay parameter or an API call (e.g play(), loadContent(), etc.).

PLAYER_PLAYBACKPERMISSION

Sent each time any playback request has failed or if the initial playback attempt has succeeded.

PLAYER_END

Sent when the playback of the content video, and eventual post-roll ad video is completed.

VIDEO_PLAY

Sent when the playback state of the content video is no longer paused, as a result of the play method or the autoplay attribute.

VIDEO_START

Sent when the player begins playback of the content video.

VIDEO_PLAYING

Sent when the content video starts playing, after the play or waiting event.

VIDEO_PAUSE

Sent when the video playback has paused.

VIDEO_END

Sent when the player completes playback of the content video.

VIDEO_SEEKSTART

Sent when the player starts to seek to another position in the video timeline.

VIDEO_SEEKEND

Sent when the player has completed a seeking operation.

VIDEO_TIMECHANGE

Sent when the playback position changes.


Settings (web)

PLAYER_ASPECTRATIOCHANGE

Sent when the aspect ratio of the player changes after calling setAspectRatio('4:3').

PLAYER_PLAYBACKSPEEDCHANGE

Sent when the playback speed changes.

PLAYER_VOLUMECHANGE

Sent when the volume level or mute state changes.

PLAYER_SCALEMODECHANGE

Sent when the scale mode of the player changes after using setScaleMode().

VIDEO_QUALITIESREADY

Sent when video qualities are available.

VIDEO_QUALITYCHANGE

Sent when the video quality changes.

VIDEO_SUBTITLESCHANGE

Sent when the current subtitle changes.

VIDEO_SUBTITLESREADY

Sent when subtitles are available.


Buffering (web)

VIDEO_BUFFERING

Sent when the player has to temporarily stop video playback for further buffering of content.


Errors (web)

PLAYER_ERROR

Sent when the player triggers an error. Error code available in the Player State object.

PLAYER_HEAVYADSINTERVENTION

Sent when the player is unloaded from the page due to Chrome browser’s heavy ads intervention policies.