Skip to content

ReplaceableTrackOptions

Defined in: relay-sdks/ts/src/replaceable-track.ts:25

Options for createReplaceableTrack.

Type Parameter Default type
F extends Frame Frame
catalog: ReplaceableTrackCatalog;

Defined in: relay-sdks/ts/src/replaceable-track.ts:42

The catalog to list the current track in.


demandWaitMs?: number;

Defined in: relay-sdks/ts/src/replaceable-track.ts:50

How long frames written to a replacement wait for its first relay subscription, in milliseconds. A listener subscribes to a replacement only once the new catalog has reached it, about a round trip, and a frame writer skips what it is handed before then: the first words of the new reply. The frames wait, in order, and go out once the relay subscribes; any still waiting when this runs out go to the writer, which skips them. 0 waits for nothing. Default 2000.


name?: (replacement) => string;

Defined in: relay-sdks/ts/src/replaceable-track.ts:34

The name of the track that replacement attempt number replacement (1 for the first) registers. Names are unique per publisher connection, including after a track closes, so each must differ from every name used before; an attempt that fails uses its name up, and the next asks for the next. Default ${track}-${replacement + 1}: audio-2, audio-3, and so on.

Parameter Type
replacement number

string


track: string;

Defined in: relay-sdks/ts/src/replaceable-track.ts:27

The first track’s name.


trackProperties?: readonly PublishProperty[];

Defined in: relay-sdks/ts/src/replaceable-track.ts:36

Every track’s properties, as registerTrack takes them.


writer?: FrameWriterOptions<F>;

Defined in: relay-sdks/ts/src/replaceable-track.ts:40

Every track’s frame writer options. Default { grouping: 'frame' }, the mapping for audio.


writeTimeoutMs?: number;

Defined in: relay-sdks/ts/src/replaceable-track.ts:38

Every track’s write timeout, as registerTrack takes it.