Interface TrackPublishDefaults

interface TrackPublishDefaults {
    audioPreset?: AudioPreset;
    backupCodec?: boolean | {
        codec: "vp8" | "h264";
        encoding?: VideoEncoding;
    };
    dtx?: boolean;
    forceStereo?: boolean;
    red?: boolean;
    scalabilityMode?: ScalabilityMode;
    screenShareEncoding?: VideoEncoding;
    screenShareSimulcastLayers?: VideoPreset[];
    simulcast?: boolean;
    stopMicTrackOnMute?: boolean;
    videoCodec?: "vp8" | "h264" | "vp9" | "av1";
    videoEncoding?: VideoEncoding;
    videoSimulcastLayers?: VideoPreset[];
}

Hierarchy (view full)

Properties

audioPreset?: AudioPreset

which audio preset should be used for publishing (audio) tracks defaults to [[AudioPresets.music]]

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

Multi-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

Type declaration

dtx?: boolean

dtx (Discontinuous Transmission of audio), enabled by default for mono tracks.

forceStereo?: boolean

publish track in stereo mode (or set to false to disable). defaults determined by capture channel count.

red?: boolean

red (Redundant Audio Data), enabled by default for mono tracks.

scalabilityMode?: ScalabilityMode

scalability mode for svc codecs, defaults to 'L3T3'. for svc codecs, simulcast is disabled.

screenShareEncoding?: VideoEncoding

encoding parameters for screen share track

screenShareSimulcastLayers?: VideoPreset[]

custom video simulcast layers for screen tracks Note: the layers need to be ordered from lowest to highest quality

simulcast?: boolean

use simulcast, defaults to true. When using simulcast, LiveKit will publish up to three versions of the stream at various resolutions.

stopMicTrackOnMute?: boolean

For 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

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

codec, defaults to vp8; for svc codecs, auto enable vp8 as backup. (TBD)

videoEncoding?: VideoEncoding

encoding parameters for camera track

videoSimulcastLayers?: VideoPreset[]

Up 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, ], }

Generated using TypeDoc