TrackPublishOptions
Defined in: client-sdk-js/src/track/options.ts:534
Options when publishing tracks. Extends TrackPublishDefaults with per-track metadata.
Extends
Section titled “Extends”Properties
Section titled “Properties”audioBitrate?
Section titled “audioBitrate?”audioBitrate?: number;Defined in: client-sdk-js/src/track/options.ts:558
Target audio bitrate in bits per second.
audioPreset?
Section titled “audioPreset?”audioPreset?: AudioPreset;Defined in: client-sdk-js/src/track/options.ts:445
Which audio preset should be used for publishing audio tracks.
Default Value
Section titled “Default Value”Inherited from
Section titled “Inherited from”TrackPublishDefaults.audioPreset
backupCodec?
Section titled “backupCodec?”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.
Default Value
Section titled “Default Value”true
Inherited from
Section titled “Inherited from”TrackPublishDefaults.backupCodec
backupCodecPolicy?
Section titled “backupCodecPolicy?”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.
Inherited from
Section titled “Inherited from”TrackPublishDefaults.backupCodecPolicy
codecOptions?
Section titled “codecOptions?”codecOptions?: PublishCodecOptions;Defined in: client-sdk-js/src/track/options.ts:527
Codec-specific options (SDP fmtp parameters) forwarded to the
underlying transport layer.
Inherited from
Section titled “Inherited from”TrackPublishDefaults.codecOptions
degradationPreference?
Section titled “degradationPreference?”degradationPreference?: RTCDegradationPreference;Defined in: client-sdk-js/src/track/options.ts:482
Degradation preference hint for the browser encoder.
Inherited from
Section titled “Inherited from”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.
Inherited from
Section titled “Inherited from”forceStereo?
Section titled “forceStereo?”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.
Inherited from
Section titled “Inherited from”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.
Inherited from
Section titled “Inherited from”scalabilityMode?
Section titled “scalabilityMode?”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.
Inherited from
Section titled “Inherited from”TrackPublishDefaults.scalabilityMode
screenShareEncoding?
Section titled “screenShareEncoding?”screenShareEncoding?: VideoEncoding;Defined in: client-sdk-js/src/track/options.ts:432
Encoding parameters for screen share tracks.
Inherited from
Section titled “Inherited from”TrackPublishDefaults.screenShareEncoding
screenShareSimulcastLayers?
Section titled “screenShareSimulcastLayers?”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.
Inherited from
Section titled “Inherited from”TrackPublishDefaults.screenShareSimulcastLayers
simulcast?
Section titled “simulcast?”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.
Inherited from
Section titled “Inherited from”TrackPublishDefaults.simulcast
source?
Section titled “source?”source?: TrackSource;Defined in: client-sdk-js/src/track/options.ts:543
Source of track — camera, microphone, or screen.
stopMicTrackOnMute?
Section titled “stopMicTrackOnMute?”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.
Default Value
Section titled “Default Value”false
Inherited from
Section titled “Inherited from”TrackPublishDefaults.stopMicTrackOnMute
stream?
Section titled “stream?”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?
Section titled “videoCodec?”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.
Inherited from
Section titled “Inherited from”TrackPublishDefaults.videoCodec
videoEncoding?
Section titled “videoEncoding?”videoEncoding?: VideoEncoding;Defined in: client-sdk-js/src/track/options.ts:406
Encoding parameters for camera track.
Inherited from
Section titled “Inherited from”TrackPublishDefaults.videoEncoding
videoSimulcastLayers?
Section titled “videoSimulcastLayers?”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.
Example
Section titled “Example”{ videoEncoding: { maxBitrate: 1_700_000, maxFramerate: 30 }, videoSimulcastLayers: [VideoPresets.h540, VideoPresets.h216],}