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.
- Node.js
- Go
await client.rtmp.start(roomId, {
streams: [{ url: "rtmp://a.rtmp.youtube.com/live2", streamKey: "yt_streamkey" }],
composition: { layout: "spotlight", quality: "high" },
});
client.RTMP.Start(ctx, roomID, videosdk.RTMPStartParams{
Streams: []videosdk.RTMPStream{{URL: "rtmp://a.rtmp.youtube.com/live2", StreamKey: "yt_streamkey"}},
Composition: &videosdk.Composition{Layout: videosdk.CompositionLayoutSpotlight, Quality: videosdk.Ptr(videosdk.CompositionQualityHigh)},
})
Options: streams (required), composition (see Composition), transcription, resourceId.
Stop
- Node.js
- Go
await client.rtmp.stop(roomId);
client.RTMP.Stop(ctx, videosdk.EgressHandle{RoomID: roomID})
List and get
- Node.js
- Go
await client.rtmp.list({ roomId });
await client.rtmp.get(id);
client.RTMP.List(ctx, videosdk.RTMPListParams{RoomID: videosdk.String(roomID)})
client.RTMP.Get(ctx, id)
The livestream object
id, roomId, sessionId, region, start, end, and outputs (the { url, streamKey } destinations).
Got a Question? Ask us on discord

