TrackPublishDefaults
Defined in: client-sdk-js/src/track/options.ts:402
Default parameters applied when publishing a track. These can be set once on RoomOptions.publishDefaults and will be used for every subsequent publish call unless overridden per-track.
Extended by
Section titled “Extended by”Properties
Section titled “Properties”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”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
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.
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.
degradationPreference?
Section titled “degradationPreference?”degradationPreference?: RTCDegradationPreference;Defined in: client-sdk-js/src/track/options.ts:482
Degradation preference hint for the browser encoder.
dtx?: boolean;Defined in: client-sdk-js/src/track/options.ts:451
DTX (Discontinuous Transmission of audio). Enabled by default for mono tracks.
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.
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.
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.
screenShareEncoding?
Section titled “screenShareEncoding?”screenShareEncoding?: VideoEncoding;Defined in: client-sdk-js/src/track/options.ts:432
Encoding parameters for screen share tracks.
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.
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.
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
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.
videoEncoding?
Section titled “videoEncoding?”videoEncoding?: VideoEncoding;Defined in: client-sdk-js/src/track/options.ts:406
Encoding parameters for camera track.
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],}