Skip to content

TrackPublishOptions

Defined in: client-sdk-js/src/track/options.ts:534

Options when publishing tracks. Extends TrackPublishDefaults with per-track metadata.

audioBitrate?: number;

Defined in: client-sdk-js/src/track/options.ts:558

Target audio bitrate in bits per second.


audioPreset?: AudioPreset;

Defined in: client-sdk-js/src/track/options.ts:445

Which audio preset should be used for publishing audio tracks.

AudioPresets.music

TrackPublishDefaults.audioPreset


backupCodec?:
| boolean
| {
codec: "vp8" | "h264";
encoding?: VideoEncoding;
};

Defined in: client-sdk-js/src/track/options.ts:419

Advanced codecs (VP9 / AV1 / H265) are not supported by all browser clients. When backupCodec is set and an incompatible client attempts to subscribe, the server will automatically publish a secondary track encoded with the backup codec.

You can customize the encoding parameters of the backup track by explicitly setting codec and encoding fields.

true

TrackPublishDefaults.backupCodec


backupCodecPolicy?: BackupCodecPolicy;

Defined in: client-sdk-js/src/track/options.ts:427

Policy for deciding whether to send the primary codec at the same time as the backup codec.

BackupCodecPolicy

TrackPublishDefaults.backupCodecPolicy


codecOptions?: PublishCodecOptions;

Defined in: client-sdk-js/src/track/options.ts:527

Codec-specific options (SDP fmtp parameters) forwarded to the underlying transport layer.

PublishCodecOptions

TrackPublishDefaults.codecOptions


degradationPreference?: RTCDegradationPreference;

Defined in: client-sdk-js/src/track/options.ts:482

Degradation preference hint for the browser encoder.

TrackPublishDefaults.degradationPreference


dtx?: boolean;

Defined in: client-sdk-js/src/track/options.ts:451

DTX (Discontinuous Transmission of audio). Enabled by default for mono tracks.

TrackPublishDefaults.dtx


forceStereo?: boolean;

Defined in: client-sdk-js/src/track/options.ts:463

Publish track in stereo mode (or set to false to disable). Default is determined by the capture channel count.

TrackPublishDefaults.forceStereo


name?: string;

Defined in: client-sdk-js/src/track/options.ts:538

A human-readable name for the track.


red?: boolean;

Defined in: client-sdk-js/src/track/options.ts:457

RED (Redundant Encoding for audio). Enabled by default for mono tracks. When using stereo, RED is automatically disabled unless explicitly set.

TrackPublishDefaults.red


scalabilityMode?: ScalabilityMode;

Defined in: client-sdk-js/src/track/options.ts:477

Scalability mode for SVC codecs, defaults to 'L3T3_KEY'. When an SVC codec is used, simulcast is disabled.

TrackPublishDefaults.scalabilityMode


screenShareEncoding?: VideoEncoding;

Defined in: client-sdk-js/src/track/options.ts:432

Encoding parameters for screen share tracks.

TrackPublishDefaults.screenShareEncoding


screenShareSimulcastLayers?: VideoPreset[];

Defined in: client-sdk-js/src/track/options.ts:506

Custom simulcast layers for screen share tracks.

Note: layers should be ordered from lowest to highest quality.

TrackPublishDefaults.screenShareSimulcastLayers


simulcast?: boolean;

Defined in: client-sdk-js/src/track/options.ts:471

Use simulcast. Defaults to true.

When using simulcast, the SDK will publish up to three versions of the stream at various resolutions.

TrackPublishDefaults.simulcast


source?: TrackSource;

Defined in: client-sdk-js/src/track/options.ts:543

Source of track — camera, microphone, or screen.


stopMicTrackOnMute?: boolean;

Defined in: client-sdk-js/src/track/options.ts:519

For local tracks, stop the underlying MediaStreamTrack when the track is muted (or paused). On some platforms this is necessary to disable the microphone recording indicator.

Note: when enabled with Bluetooth devices connected, they will transition between profiles (e.g. HFP to A2DP) causing an audible difference in playback.

false

TrackPublishDefaults.stopMicTrackOnMute


stream?: string;

Defined in: client-sdk-js/src/track/options.ts:553

Set a stream name for the track. Audio and video tracks with the same stream name will be placed in the same MediaStream and offer better synchronisation.

By default, camera and microphone are placed in one stream; screen share video and audio in another.


videoCodec?: "vp8" | "h264" | "vp9" | "av1" | "h265";

Defined in: client-sdk-js/src/track/options.ts:438

Video codec, defaults to 'vp8'. For SVC codecs, auto-enable 'vp8' as backup.

TrackPublishDefaults.videoCodec


videoEncoding?: VideoEncoding;

Defined in: client-sdk-js/src/track/options.ts:406

Encoding parameters for camera track.

TrackPublishDefaults.videoEncoding


videoSimulcastLayers?: VideoPreset[];

Defined in: client-sdk-js/src/track/options.ts:499

Up to two additional simulcast layers to publish in addition to the original track.

When left blank, it defaults to [VideoPresets.h180, VideoPresets.h360]. If an SVC codec is used (VP9 or AV1), this field has no effect.

{
videoEncoding: { maxBitrate: 1_700_000, maxFramerate: 30 },
videoSimulcastLayers: [VideoPresets.h540, VideoPresets.h216],
}

TrackPublishDefaults.videoSimulcastLayers