Skip to main content

HLS

The hls resource runs HLS playback streams for broadcasting a meeting to a large audience. Start a stream with start, and stop it with stop by passing its room id.

Start HLS​

await client.hls.start(roomId, {
composition: { layout: "spotlight", quality: "high" },
});

Options: composition (see Composition), transcription, webhookUrl, recording, templateUrl, resourceId.

Get the active stream​

Returns the active stream with its playback URLs, or an error if none is active. Use getById / GetByID to fetch a stream by id rather than by room.

const stream = await client.hls.get(roomId);
stream.playbackHlsUrl; // manifest URL for players

Stop HLS​

await client.hls.stop(roomId);

Capture a thumbnail​

await client.hls.capture({ roomId, format: "png", width: 1280, height: 720 });

Options: roomId (required), format (png, jpg, webp), width, height, time (seconds, omit to capture in real time).

List and delete​

await client.hls.list({ roomId });
await client.hls.delete(id);

The HLS stream object​

hls.get, getById, and list return this object.

FieldTypeDescription
idstringHLS stream id.
roomIdstringRoom this stream belongs to.
sessionIdstringSession this stream belongs to.
qualitystringStream quality.
orientationstringVideo orientation.
durationnumberDuration in seconds.
playbackHlsUrlstringHLS playback URL.
livestreamUrlstringLivestream URL.
downstreamUrlstringDownstream URL.
startstringStart time (ISO-8601).
endstringEnd time, null while live.

Composition​

The composition option controls the layout and rendering of the stream. Provide a named layout or a custom template URL.

FieldValues
layoutgrid, spotlight, sidebar, or a custom template URL
prioritySPEAKER or PIN
gridSizetiles in grid, 0-25 (default 25)
orientationportrait or landscape
themeDARK, LIGHT, or DEFAULT
qualitylow, med, high, or ultra

There is no resolution option. Use quality.

Got a Question? Ask us on discord