Skip to main content

RTMP

The rtmp resource pushes a room to external RTMP destinations like YouTube, Twitch, or any RTMP endpoint. start returns a handle you stop by room id.

Start a live stream

At least one destination is required, and RTMP needs a layout.

await client.rtmp.start(roomId, {
streams: [{ url: "rtmp://a.rtmp.youtube.com/live2", streamKey: "yt_streamkey" }],
composition: { layout: "spotlight", quality: "high" },
});

Options: streams (required), composition (see Composition), transcription, resourceId.

Stop

await client.rtmp.stop(roomId);

List and get

await client.rtmp.list({ roomId });
await client.rtmp.get(id);

The livestream object

id, roomId, sessionId, region, start, end, and outputs (the { url, streamKey } destinations).

Got a Question? Ask us on discord