startStream

View as Markdown

startStream

Starts streaming the audio/video of this room to an external service. You can use the returned RoomSessionStream object to interact with the stream.

Parameters

params
object

Object containing the parameters of the method.

url
string

RTMP or RTMPS url. This must be the address of a server accepting incoming RTMP/RTMPS streams.

Returns

Promise<RoomSessionStream> - See RoomSessionStream documentation for more details.

Permissions

  • room.stream (or the more specific room.stream.start)

You need to specify the permissions when creating the Video Room Token on the server side.

Example

1const stream = await roomSession.startStream({ url: "rtmp://example.com" });
2
3// Stop the stream after 60 seconds
4setTimeout(() => stream.stop(), 60000);