element-call-Github/src/livekit/options.ts
Daniel Abramov 19a2494b9b Fix screen-sharing on Chrome
- Disable temporal layers
- Make 30 fps screen-sharing
2023-07-07 14:27:01 +01:00

46 lines
1.2 KiB
TypeScript

import {
AudioPresets,
DefaultReconnectPolicy,
RoomOptions,
ScreenSharePresets,
TrackPublishDefaults,
VideoPreset,
VideoPresets,
} from "livekit-client";
const defaultLiveKitPublishOptions: TrackPublishDefaults = {
audioPreset: AudioPresets.music,
dtx: true,
red: true,
forceStereo: false,
simulcast: true,
videoSimulcastLayers: [VideoPresets.h180, VideoPresets.h216] as VideoPreset[],
screenShareEncoding: ScreenSharePresets.h1080fps30.encoding,
stopMicTrackOnMute: false,
videoCodec: "vp8",
videoEncoding: VideoPresets.h360.encoding,
backupCodec: { codec: "vp8", encoding: VideoPresets.h360.encoding },
} as const;
export const defaultLiveKitOptions: RoomOptions = {
// automatically manage subscribed video quality
adaptiveStream: true,
// optimize publishing bandwidth and CPU for published tracks
dynacast: true,
// capture settings
videoCaptureDefaults: {
resolution: VideoPresets.h360.resolution,
},
// publish settings
publishDefaults: defaultLiveKitPublishOptions,
// default LiveKit options that seem to be sane
stopLocalTrackOnUnpublish: true,
reconnectPolicy: new DefaultReconnectPolicy(),
disconnectOnPageLeave: true,
expWebAudioMix: false,
};