RoomSessionStream
Represents a specific stream of a room session. This is an RTMP stream of the audio/video content of the room, which will be sent to an external party (e.g., to YouTube).
You can start a stream with RoomSession.startStream.
Properties
The unique id of this stream.
The id of the room associated to this stream.
The id of the room session associated to this stream.
Current state of the stream.
The RTMP URL of the stream.
Total seconds of time spent streaming, if available. This is equal to (endedAt - startedAt).
Start time, if available.
End time, if available.
Whether the stream has ended. Returns true if the state is "completed".
Methods
stop
- stop():
Promise<void>
Stops the stream.
Returns
Promise<void>
Example
In this example, we wait for a room to start and then start
a stream in that room. We then stop the stream after 10 seconds.
This example assumes that there is a RoomSession already active and that members are joining the room.
Events
onStarted
- RoomSessionStream(
{ listen: {onStarted: Callback }})
Emitted when the stream has started.
Parameters
The stream that has started. See RoomSessionStream.
onEnded
- RoomSessionStream(
{ listen: {onEnded: Callback } })
Emitted when the stream has ended.
Parameters
The stream that has ended. See RoomSessionStream.