Skip to main content

Playbacks

Besides image data you can playback videos. We currently limit it to media files in webm (preferred) or mp4/mp3 format that have to be available through a public URL. Note that we do not provide any kind of upload service for this feature.

POST /rooms/<access_key>/playbacks # play a video
RESPONSES 201 CREATED, 400 BAD REQUEST, 404 NOT FOUND, 409 CONFLICT, 410 GONE
ParametersTypeDescription
audioBooleanPlay audio (default: false)
play_idStringChoose an identifier, e.g. current timestamp or use a custom layout position identifier
replacement_idStringUser-id of the participants video to be replaced
urlString (required)Hosted MP4/WEBM video or MP3 audio file
nameStringCustom readable name for identification
loop_countNumberNumber of repetitions. Set -1 for infinite loop. (Doesn't work with h264 video codec) (default: 0)

If replacement_id is set, the video will replace the current stream of a specific user. Without replacement_id, the video is attached as a new spot.

For sure, you can use the layout to set this user or the play_id to fullscreen during the video playback and switch back afterwards using the layout feature. As with layers, ensure to disable SFU mode.

caution

The feature loop_count will NOT work if video codec is h264! You can check this for example with ffprobe (see ffprobe documentation).

note

The former "playback" object e.g. playback[url]=... is not needed anymore, but can still be used.

Stop playback

If the playback has been started with play_id, it can be stopped using the following request:

DELETE /rooms/<access_key>/playbacks/<play_id> # stop playback with play_id
RESPONSES 200 OK, 404 NOT FOUND