From e21868ed3b66af3dd722774c85e9d4d633563585 Mon Sep 17 00:00:00 2001 From: kharhamel Date: Tue, 16 Feb 2021 18:25:23 +0100 Subject: [PATCH] FIX: current audio and video status are overwriten by jitsi config --- front/src/WebRtc/JitsiFactory.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/front/src/WebRtc/JitsiFactory.ts b/front/src/WebRtc/JitsiFactory.ts index 7d470754..bb613316 100644 --- a/front/src/WebRtc/JitsiFactory.ts +++ b/front/src/WebRtc/JitsiFactory.ts @@ -3,10 +3,12 @@ import {mediaManager} from "./MediaManager"; import {coWebsiteManager} from "./CoWebsiteManager"; declare const window:any; // eslint-disable-line @typescript-eslint/no-explicit-any -const defaultConfig = { - startWithAudioMuted: !mediaManager.constraintsMedia.audio, - startWithVideoMuted: mediaManager.constraintsMedia.video === false, - prejoinPageEnabled: false +const getDefaultConfig = () => { + return { + startWithAudioMuted: !mediaManager.constraintsMedia.audio, + startWithVideoMuted: mediaManager.constraintsMedia.video === false, + prejoinPageEnabled: false + } } const defaultInterfaceConfig = { @@ -66,7 +68,7 @@ class JitsiFactory { width: "100%", height: "100%", parentNode: cowebsiteDiv, - configOverwrite: {...defaultConfig, ...config}, + configOverwrite: {...config, ...getDefaultConfig()}, interfaceConfigOverwrite: {...defaultInterfaceConfig, ...interfaceConfig} }; if (!options.jwt) {