livqenoDocs

ConceptsLive stream

Live stream

A room plus a chat conversation, with host and viewer roles. Built on RTC and Chat.

A live stream is one host (plus optional co-hosts) broadcasting to many viewers, with a chat attached. Viewers can watch and chat, but can't send video or audio.

Use a live stream when a few people present and many people watch: a webinar, a live class, a product launch, a Friday Q&A. If everyone needs to talk, use a normal room instead.

Your backend creates the stream and makes credentials for hosts and viewers. Each app joins with its credentials.

How it's built

A live stream is not a separate system. It's built from two things you already know. Creating one sets up:

When you make credentials for a stream, you get tokens for both.

LiveStream.room is a real Room, and LiveStream.chat is a real ChatClient. Everything in the RTC and Chat docs works on a stream too.

Roles

RoleCan publish?How they get itExample
HOSTYesWhoever created the streamThe presenter
CO_HOSTYesPOST /v1/live-streams/{id}/hostsA guest speaker
VIEWERNoPOST /v1/live-streams/{id}/viewer-tokensEveryone watching

A viewer's RTC token has publish: false signed into it. So a viewer can never publish, even with a modified app. Viewers aren't saved as records; they're just counted.

A stream only moves forward

CREATED → LIVE → ENDED
StateMeans
CREATEDSet up, not started yet. Hosts can get ready.
LIVEBroadcasting. Viewers can watch.
ENDEDOver. Final.
  • ENDED is final. You can't restart it. For next week's Q&A, create a new stream.
  • Starting a stream that's already live, or doing anything on an ended one, fails with RAVEN_STREAM_INVALID_STATE.

Example

On your backend, create the stream, then make credentials for the host and for one viewer:

const stream = await livqeno.liveStreams.create({
  title: 'Friday Q&A',
  hostIdentity: 'user-1',   // required — a stream is created with its host
});
const host = await livqeno.liveStreams.addHost(stream.id, { identity: 'user-1' });   // host credentials
const viewer = await livqeno.liveStreams.createViewerToken(stream.id, 'user-2');

Send host to the host's app, and viewer to the viewer's app.

In the host's app, join with those credentials (called hostCredentials below), turn on the camera, and greet the chat:

import { LiveStream } from '@livqeno/live';
 
const live = await LiveStream.join(hostCredentials);
await live.room.enableCamera();
await live.chat!.sendMessage({ text: "We're live" });

Replays

A stream in broadcast mode (BROADCAST, viewers on HLS) is saved from its HLS copy as it runs. When it ends, the replay is ready: the live_stream.recording_ready webhook carries its recordingUrl and duration, and the stream's recordingUrl is set. A real-time stream (RTC_ONLY) isn't saved, and neither is an ordinary call (an RTC room). Plan for this if people expect a replay.

Next steps

  1. Live Streaming: the product overview.
  2. Live streaming quickstart: a working stream, step by step.
  3. Streams & lifecycle: starting, ending, and limits.