Totem Player API

Control playback on your Android TV remotely.

General Information

The server runs locally on the Android TV device.

1. Play Content

Starts video playback. If something is playing, it interrupts it immediately.

POST /play

Body (JSON):

{ "url": "https://...", // Required "title": "Big Buck Bunny", // Optional "posterUrl": "https://...", // Optional (Background) "userAgent": "TotemClient/1.0", // Optional "metadata": "Extra info", // Optional "startPosition": "0" // Optional }

2. Remote Control

Sends transport and configuration commands to the active player.

POST /command

Body (JSON):

{ "command": "PLAY", "value": "" // Optional depending on command }

Supported Commands:

Command Value (value) Description
PLAY-Resumes playback.
PAUSE-Pauses playback.
STOP-Stops and returns to start.
SEEKLong (ms)Jumps to position (e.g., "15000").
FORWARD-Forward 10 seconds.
REWIND-Rewind 10 seconds.
METADATAStringChange image subtitle.
MESSAGEStringSend message to screen.
VOLUMEFloat (0.0 - 1.0)Set volume (e.g., "0.5").
SPEEDFloatSet speed (e.g., "1.5").
POSTERStringChange main image URL.
VIDEOString (iso)Change video track (e.g., "es", "en").
AUDIOString (iso)Change audio track (e.g., "es", "en").
SUBTITLEString (iso)Change subtitle (e.g., "en", "off").

3. Get Status

Polling to synchronize your remote control interface.

GET /status

Success Response (200 OK):

{ "state": "PLAYING", // IDLE, BUFFERING, PLAYING, PAUSED... "currentPosition": 15000,// current ms "duration": 60000, // total ms "isLive": false, "volume": 1.0, "speed": 1.0, "title": "Big Buck Bunny", "audioTracks": List_TrackDefinition, "subtitleTracks": List_TrackDefinition, "videoQualities": List_TrackDefinition }

Error 503: If the player is not initialized.