startLivestream

suspend fun startLivestream(outputs: List<LivestreamOutput>, config: LivestreamConfig? = null)

Asks the server to push the room to one or more RTMP destinations — YouTube Live, Twitch, your own ingest.

RoomEventListener.onLivestreamStarted is the confirmation that it is running; RoomEventListener.onLivestreamStateChanged reports each step in between.

A start the server refuses throws, and RoomEventListener.onError receives code 4013 (START_LIVESTREAM_FAILED) with the server's reason. The same code reaches onError if the server accepted the request but the stream has not started 30 seconds later, which usually means the RTMP destination is unreachable.

Parameters

outputs

where to stream; an empty list does nothing at all, not even an error.

config

stream layout, theme and recording; null uses the room's defaults.