play

View as Markdown

play

Starts a playback in the room. You can use the returned RoomSessionPlayback object to control the playback (e.g., pause, resume, setVolume and stop).

Parameters

NameTypeDescription
paramsObject-
params.urlstringThe url (http, https, rtmp, rtmps) of the stream to reproduce.
params.seekPosition?numberThe starting timecode in milliseconds for playback. Defaults to 0.
params.positions?VideoPositionsPositions to assign as soon as the playback starts. You can use the special keyword self to refer to the id of the playback.
params.layout?stringLayout to change to when the playback starts.

Returns

Promise<RoomSessionPlayback> - See RoomSessionPlayback for more details.

Example

1const playback = await roomSession.play({ url: "rtmp://example.com/foo" });
2await playback.stop();