Playbacks
Start Playback
Video and audio playback can be added to meetings in addition to image data. Media files must be available through a public URL and can be in WEBM format (recommended) or MP4/MP3 format.
This feature provides playback capabilities only - you are responsible for hosting and serving the media files from your own storage infrastructure.
POST /rooms/`ACCESS_KEY`/playbacks
RESPONSES 201 CREATED, 400 BAD REQUEST, 404 NOT FOUND, 409 CONFLICT, 410 GONE
REQUIRED url
RECOMMENDED play_id, loop_count
Req/Res Example: Start Playback
- curl
- node sdk
- go sdk
- php sdk
export ACCESS_KEY=...
curl -X POST \
-H "Content-Type: application/json" \
-d "{\"url\":\"https://storage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4\", \"play_id\":\"bigbuckbunny\", \"loop_count\": \"-1\"}" \
"https://api.eyeson.team/rooms/$ACCESS_KEY/playbacks"
const accessKey = '...';
const eyeson = new Eyeson();
const user = await eyeson.getUser(accessKey);
await user.startPlayback({
play_id: 'bigbuckbunny',
url: 'https://storage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4',
loop_count: -1,
});
accessKey := "..."
userService, _ := eyeson.NewUserServiceFromAccessKey(accessKey)
userService.StartPlayback("https://storage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4", &eyeson.PlaybackOptions{
PlayID: "bigbuckbunny",
LoopCount: -1,
})
$accessKey = '...';
$eyeson = new Eyeson();
$playback = $eyeson->playback($accessKey, [
'play_id' => 'bigbuckbunny',
'url' => 'https://storage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4',
'loop_count' => -1
]);
$playback->start();
No Response
url
Type: URL
(required)
Public MP4/WEBM video or MP3 audio file
audio
type: BOOLEAN
(optional)
Default: FALSE
Mute/Unmute video files
play_id
Type: STRING
(optional)
Choose an identifier, e.g. current timestamp or use a custom layout position identifier.
replacement_id
Type: STRING
(optional)
User-id of the participants video to be replaced
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.
You can use the layout to set the 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.
name
Type: STRING
(optional)
Custom readable name for identification
loop_count
Type: NUMBER
(optional)
Default: 0
Controls the playback repetition.
Value | Description |
---|---|
-1 | Playback loops infinitely. |
0 | Playback is played just once. |
N | Loops the playback N + 1 times. |
The loop_count
supports these file types & encoders:
- WEBM (VP8, VP9) with MP3 (opus, vorbis, flac & mp3lame)
- MP4 (H.264) with MP3 (aac)
- MP3 (flac & mp3lame)
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`
RESPONSES 200 OK, 404 NOT FOUND
Req/Res Example: Stop Playback
- curl
- node sdk
- go sdk
- php sdk
export ACCESS_KEY=...
export PLAY_ID=...
curl -X DELETE "https://api.eyeson.team/rooms/$ACCESS_KEY/playbacks/$PLAY_ID"
const accessKey = '...';
const playId = '...';
const eyeson = new Eyeson();
const user = await eyeson.getUser(accessKey);
await user.stopPlayback(playId);
accessKey := "..."
playId := "..."
userService, _ := eyeson.NewUserServiceFromAccessKey(accessKey)
userService.StopPlayback(playId)
$accessKey = '...';
$playId = '...';
$eyeson = new Eyeson();
$playback = $eyeson->playback($accessKey, ['play_id' => $playId]);
$playback->stop();
No Response