Media Player Integration
API Reference

Player Events

10min

Please note: This documentation is currently being revised. It may therefore be incomplete in some parts.

In this section, you will find a comprehensive description of all events emitted by the player. This collection presents diverse options for handling these events. The Event property of the player exposes all event types.

When registering listeners using the player's on() method, ensure the usage of the corresponding enum values to avoid missing events caused by incorrect typing in event types.

player.Event.CTA_SOCIAL_SHARING_INIT

Sent when the visitor clicks the social sharing call-to-action (CTA), triggering the display of the social sharing modal.

player.Event.DISMISS

Sent when the visitor closes or dismisses the player.

Please note that embedded media players cannot be dismissed, so this event type does not apply to them.

player.Event.INIT

Sent when the player begins its initialization process.

For players that are triggered by user interaction, the INIT event, along with the READY event, can be utilized to show a loading indicator on your either on your website or the trigger element while the player is being loaded.

player.Event.MEDIA_COMPLETE

Sent when the media playback of the current media item has reached or exceeded 95% of its total duration.

player.Event.MEDIA_INIT

Sent when the player initiates the initialization of a new media item.

player.Event.MEDIA_PAUSE

Sent when the media playback of the current media item is paused, either triggered by a visitor interaction or an external event such as a document visibilitychange event.

player.Event.MEDIA_PROGRESS

To be added

player.Event.MEDIA_READY

Sent when the media content of the current media item has completed loading.

For video content, it signifies that the first streamable chunk of the video has been loaded. In case of static content, such as a high-resolution image, this indicates the image has finished loading.

player.Event.MEDIA_RESUME

Sent when the media playback of the current media item is resumed, either triggered by a visitor interaction or an external event such as a document visibilitychange event.

player.Event.MEDIA_SKIP

Sent when the player skips to one of the following targets:

  • previousItem — The previous media item within a current playlist.
  • previousPlaylist — The previous playlist.
  • nextItem — The next media item within a playlist.
  • nextPlaylist — The next playlist.

SKIP events can be triggered either by visitor interaction or when the media playback of the current media item is completed.

player.Event.MEDIA_START

Sent when the current media item begins playing, triggered either by a visitor interaction or media autoplay.

player.Event.OPEN

Sent when the player opens.

player.Event.READY

Sent when the player completed its initialization process and finished rendering.

player.Event.TRANSITION

Sent when the player switches its rendering mode.

Updated 25 Mar 2024
Doc contributor
Did this page help you?