Optional
audiowhich audio preset should be used for publishing (audio) tracks defaults to [[AudioPresets.music]]
Optional
backupMulti-codec Simulcast VP9 and AV1 are not supported by all browser clients. When backupCodec is set, when an incompatible client attempts to subscribe to the track, LiveKit will automatically publish a secondary track encoded with the backup codec.
You could customize specific encoding parameters of the backup track by explicitly setting codec and encoding fields.
Defaults to true
Optional
degradationdegradation preference
Optional
dtxdtx (Discontinuous Transmission of audio), enabled by default for mono tracks.
Optional
forcepublish track in stereo mode (or set to false to disable). defaults determined by capture channel count.
Optional
nameset a track name
Optional
redred (Redundant Audio Data), enabled by default for mono tracks.
Optional
scalabilityscalability mode for svc codecs, defaults to 'L3T3_KEY'. for svc codecs, simulcast is disabled.
Optional
screenencoding parameters for screen share track
Optional
screencustom video simulcast layers for screen tracks Note: the layers need to be ordered from lowest to highest quality
Optional
simulcastuse simulcast, defaults to true. When using simulcast, LiveKit will publish up to three versions of the stream at various resolutions.
Optional
sourceSource of track, camera, microphone, or screen
Optional
stopFor local tracks, stop the underlying MediaStreamTrack when the track is muted (or paused) on some platforms, this option is necessary to disable the microphone recording indicator. Note: when this is enabled, and BT devices are connected, they will transition between profiles (e.g. HFP to A2DP) and there will be an audible difference in playback.
defaults to false
Optional
streamSet stream name for the track. Audio and video tracks with the same stream name
will be placed in the same MediaStream
and offer better synchronization.
By default, camera and microphone will be placed in a stream; as would screen_share and screen_share_audio
Optional
videocodec, defaults to vp8; for svc codecs, auto enable vp8 as backup. (TBD)
Optional
videoencoding parameters for camera track
Optional
videoUp to two additional simulcast layers to publish in addition to the original Track. When left blank, it defaults to h180, h360. If a SVC codec is used (VP9 or AV1), this field has no effect.
To publish three total layers, you would specify: { videoEncoding: {...}, // encoding of the primary layer videoSimulcastLayers: [ VideoPresets.h540, VideoPresets.h216, ], }
Options when publishing tracks