Embed API
The Tella Embed API allows you to control embedded videos using JavaScript’spostMessage 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 usingpostMessage. 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 usingwindow.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
When sending commands, you can use either the specific origin or'*':