Skip to content

TrackProcessor

Defined in: client-sdk-js/src/track/processor/types.ts:27

Experimental

A track processor transforms a MediaStreamTrack before publishing.

Implementors must provide at least init, restart, and destroy. The SDK calls these methods at the appropriate lifecycle moments.

After init (and restart), the processor MUST set processedTrack to the transformed output track. The SDK will publish this track instead of the original.

T extends TrackKind = TrackKind

destroy: () => Promise<void>;

Defined in: client-sdk-js/src/track/processor/types.ts:48

Experimental

Destroy the processor and release all resources. After calling this, processedTrack should be undefined.

Promise<void>


init: (opts) => Promise<void>;

Defined in: client-sdk-js/src/track/processor/types.ts:35

Experimental

Initialize the processor with the given options. After this call, processedTrack must be set.

ProcessorOptions<T>

Promise<void>


name: string;

Defined in: client-sdk-js/src/track/processor/types.ts:29

Experimental

Human-readable processor name (for logging/debugging).


processedTrack?: MediaStreamTrack;

Defined in: client-sdk-js/src/track/processor/types.ts:54

Experimental

The transformed output track. Must be set after init / restart. The SDK publishes this track instead of the original source.


restart: (opts) => Promise<void>;

Defined in: client-sdk-js/src/track/processor/types.ts:42

Experimental

Restart the processor (e.g. when the source track changes). The implementation should release old resources and re-initialize with the new options.

ProcessorOptions<T>

Promise<void>