HLS
The hls resource runs HLS playback streams, the way you broadcast a meeting to a large audience. start returns a handle you stop by room id.
Start HLS
- Node.js
- Go
await client.hls.start(roomId, {
composition: { layout: "spotlight", quality: "high" },
});
client.HLS.Start(ctx, roomID, videosdk.HLSStartParams{
Composition: &videosdk.Composition{Layout: videosdk.CompositionLayoutSpotlight, Quality: videosdk.Ptr(videosdk.CompositionQualityHigh)},
})
Options: composition (see Composition), transcription, webhookUrl, recording, templateUrl, resourceId. HLS storage is set at the API-key level, so there is no per-call dirPath.
Get the active stream
Returns the live stream with its playback URLs, or errors if none is active. Use getById / GetByID to fetch a stream by id instead of by room.
- Node.js
- Go
const stream = await client.hls.get(roomId);
stream.playbackHlsUrl; // manifest URL for players
stream, err := client.HLS.Get(ctx, roomID)
fmt.Println(stream.PlaybackHLSURL) // manifest URL for players
Stop HLS
- Node.js
- Go
await client.hls.stop(roomId);
client.HLS.Stop(ctx, videosdk.EgressHandle{RoomID: roomID})
Capture a thumbnail
- Node.js
- Go
await client.hls.capture({ roomId, format: "png", width: 1280, height: 720 });
client.HLS.Capture(ctx, videosdk.HLSCaptureParams{
RoomID: roomID,
Format: videosdk.HLSCapturePNG,
Width: videosdk.Int(1280),
Height: videosdk.Int(720),
})
Options: roomId (required), format (png, jpg, webp), width, height, time (seconds; omit to capture in real time).
List and delete
- Node.js
- Go
await client.hls.list({ roomId });
await client.hls.delete(id);
client.HLS.List(ctx, videosdk.HLSListParams{RoomID: videosdk.String(roomID)})
client.HLS.Delete(ctx, id)
The HLS stream object
id, roomId, sessionId, quality, orientation, duration, start, end, and the playback URLs playbackHlsUrl, livestreamUrl, downstreamUrl.
Got a Question? Ask us on discord

