play
play
- play(
params):Promise<RoomSessionPlayback>
Start a playback in the room. You can use the returned RoomSessionPlayback object to control the playback (e.g., pause, resume, setVolume and stop).
Parameters
Object containing the parameters of the method.
The url (http, https, rtmp, rtmps) of the stream to reproduce.
The starting timecode in milliseconds for playback.
The playback volume from -50 to 50.
Positions to assign as soon as the playback starts. You can use the special keyword self to refer to the id of the playback.
Layout to change to when the playback starts.
Object of event listeners. See RoomSessionPlayback Events for a list of valid events. Example event: onStarted.
Returns
Promise<RoomSessionPlayback>
A promise that resolves to a RoomSessionPlayback object.
Example
In this example, we wait for a room to start and then play a video in that room.
When a second member joins the roomSession, we stop the playback.
This example assumes that there is a RoomSession
already active and that members are joining the room.