For the complete documentation index, see llms.txt. This page is also available as Markdown.

Player Events

Configure custom code that runs on player lifecycle events such as play, pause, frame, mute, and replay

Use Player Events when custom code should run at a specific player lifecycle moment. Player-event logic can support advanced interactions, external calls, state updates, frame-based behavior, and custom analytics-adjacent workflows.

Shared Studio connector detail panel where advanced connector behavior, source mode, and internal description controls are configured

Event Types

Event
When it runs
Common use

onAllReady

When the video is ready to play.

Initialize custom state or prepare external behavior.

onFirstPlay

Immediately after the viewer clicks play for the first time.

Trigger first-play logic that should run once.

onPlay

Every time the viewer presses play.

Resume state, trigger play-specific behavior, or restart a custom timer.

onFrame

When the video reaches a configured frame.

Trigger frame-specific behavior, reveal logic, or external calls.

onReplay

When the viewer finishes watching and presses replay.

Reset custom state for another viewing pass.

onPause

When the viewer pauses the video.

Pause custom timers or update external state.

onMute

When the viewer mutes the video.

Update audio-related state or custom UI logic.

onUnmute

When the viewer unmutes the video.

Restore audio-related state or custom UI logic.

Options

Option
What it controls
Notes

Event trigger

The lifecycle event that runs the code.

Choose the narrowest event that matches the desired behavior.

Frame value

The frame that triggers onFrame.

Confirm the frame exists and is reached in every relevant path.

Custom code

The JavaScript that runs for the event.

Keep the code focused on the event's purpose.

Input values

Any project data, live-control value, or state referenced by the code.

Confirm referenced values exist and have fallbacks.

Repeat behavior

Whether the code should run once or every time the event occurs.

Important for onPlay, onPause, onMute, onUnmute, and replay flows.

Failure handling

What happens if a value is missing or an external action fails.

Avoid blocking normal playback.

Configure a Player Event

1

Choose the Event

Select the lifecycle moment that should run the code.

2

Define the Behavior

Write down what the event should do and whether it should happen once, every time, or only under a condition.

3

Add the Code

Add the event code and keep any data references aligned with the project schema.

4

Add Failure Handling

Make sure missing data, repeated triggers, and external failures do not break normal playback.

5

Test the Playback Path

Preview the experience through play, pause, mute, unmute, frame triggers, completion, and replay when those events are used.

Success Checks

Before publishing Player Events, confirm:

  • The selected event matches the intended playback moment.

  • Repeated events do not run code more often than intended.

  • onFrame triggers at the correct frame in each relevant path.

  • Missing data and external failures do not stop playback.

  • Custom event code does not interfere with analytics, form submission, links, or normal player controls.

Data in Studio

Last updated