OptionalaudioOptionalbackupAdvanced codecs (VP9/AV1/H265) 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
OptionalbackupWhen backup codec is enabled, there are two options to decide whether to send the primary codec at the same time:
Optionaldegradationdegradation preference
Optionaldtxdtx (Discontinuous Transmission of audio), enabled by default for mono tracks.
Optionalforcepublish track in stereo mode (or set to false to disable). defaults determined by capture channel count.
OptionalpreEnables preconnect buffer for a user's microphone track. This is useful for reducing perceived latency when the user starts to speak before the connection is established. Only works for agent use cases.
Defaults to false.
Optionalredred (Redundant Audio Data), enabled by default for mono tracks.
Optionalscalabilityscalability mode for svc codecs, defaults to 'L3T3_KEY'. for svc codecs, simulcast is disabled.
Optionalscreenencoding parameters for screen share track
Optionalscreencustom video simulcast layers for screen tracks Note: the layers need to be ordered from lowest to highest quality
Optionalsimulcastuse simulcast, defaults to true. When using simulcast, LiveKit will publish up to three versions of the stream at various resolutions.
OptionalstopFor 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
Optionalvideocodec, defaults to vp8; for svc codecs, auto enable vp8 as backup. (TBD)
Optionalvideoencoding parameters for camera track
OptionalvideoUp 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, ], }
which audio preset should be used for publishing (audio) tracks defaults to [[AudioPresets.music]]