Skip to main content

Embed API

The Tella Embed API allows you to control embedded videos using JavaScript’s postMessage API. This enables you to build custom video experiences, synchronize playback with your application, and respond to playback events.

Quick start

Commands

Send commands to the embedded player using postMessage. All commands are sent as JSON objects with a type field.
Always wait for the ready event before sending commands to ensure the player is initialized.

Play

Start video playback.

Pause

Pause video playback.

Seek

Jump to a specific time in the video.

Mute

Mute the video audio.

Unmute

Unmute the video audio.

Set volume

Set the video volume level.

Events

The embedded player sends events to the parent window. Listen for these events using window.addEventListener.

Ready

Sent once when the player is initialized and ready to receive commands.

Playback state

Sent when the playback state changes (play, pause, stop, etc.).

Time update

Sent approximately every 250ms during playback to report the current time.

Complete example

Here’s a complete example showing how to build a custom video controller:

Security considerations

Always verify the event.origin when receiving messages to ensure they come from https://www.tella.tv.
When sending commands, you can use either the specific origin or '*':

Embed URL parameters

You can customize the initial embed behavior using URL parameters: