Skip to main content

Broadcasting

ActivePlaceholderAPI

Synthetic media source rendered while no real source is available. Used during loading or as a privacy placeholder; implementations may draw a canvas, loop a silent video, or play silent audio. Combines the Disposable contract with start/stop controls and access to the underlying element.

interface ActivePlaceholderAPI {
canvasInterval?: __global.NodeJS.Timeout | literal;
element: CanvasElement | VideoElement | literal;
isDisposed: boolean;
}

BroadcastAPI

Public API for an active broadcast. Combines an event emitter over BroadcastEvents with the Disposable contract and exposes controls for mute, visibility, pause/resume, and hot-swap producer replacement.

interface BroadcastAPI {
__events: BroadcastEvents;
audioMuted: boolean;
error: Error | literal;
isDisposed: boolean;
state: active | paused | closed | stall | error;
streamName: string;
videoHidden: boolean;
}

ActivePlaceholderOptions

Input shape accepted by activePlaceholderOptionsSchema before parsing.

type ActivePlaceholderOptions = input<query>
input

BroadcastEvents

Event map emitted by a BroadcastAPI instance. Subscribers receive mute and visibility transitions, state changes, errors, and the zero-bitrate signal.

type BroadcastEvents = {
audioMuted: boolean;
disposed: void;
error: Error;
state: active | paused | closed | stall | error;
videoHidden: boolean;
zeroBitrate: object;
}

BroadcastOptions

Options for configuring a broadcast. Identifies the stream by name and carries the per-producer options, simulcast layering, and zero-bitrate detection thresholds.

type BroadcastOptions = {
audioProducerOptions?: PeerProducerOptions;
disposeController?: boolean;
simulcast?: object;
streamName: string;
videoOnly?: boolean;
videoProducerOptions?: PeerProducerOptions;
zeroBitrate?: object;
}

PeerProducerOptions

Options for configuring a per-track producer within a broadcast — stream type, simulcast layers, audio/video focus, and free-form app data.

interface PeerProducerOptions {
appData?: Json;
audioOnly?: boolean;
simulcast?: object;
streamType?: string;
videoOnly?: boolean;
}