Merge pull request #753 from thecodingmachine/fixJitsiConfig

FIX: current audio and video status are overwriten by jitsi config
This commit is contained in:
Kharhamel 2021-02-16 19:02:52 +01:00 committed by GitHub
commit f00d07289c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,10 +3,12 @@ import {mediaManager} from "./MediaManager";
import {coWebsiteManager} from "./CoWebsiteManager"; import {coWebsiteManager} from "./CoWebsiteManager";
declare const window:any; // eslint-disable-line @typescript-eslint/no-explicit-any declare const window:any; // eslint-disable-line @typescript-eslint/no-explicit-any
const defaultConfig = { const getDefaultConfig = () => {
startWithAudioMuted: !mediaManager.constraintsMedia.audio, return {
startWithVideoMuted: mediaManager.constraintsMedia.video === false, startWithAudioMuted: !mediaManager.constraintsMedia.audio,
prejoinPageEnabled: false startWithVideoMuted: mediaManager.constraintsMedia.video === false,
prejoinPageEnabled: false
}
} }
const defaultInterfaceConfig = { const defaultInterfaceConfig = {
@ -66,7 +68,7 @@ class JitsiFactory {
width: "100%", width: "100%",
height: "100%", height: "100%",
parentNode: cowebsiteDiv, parentNode: cowebsiteDiv,
configOverwrite: {...defaultConfig, ...config}, configOverwrite: {...config, ...getDefaultConfig()},
interfaceConfigOverwrite: {...defaultInterfaceConfig, ...interfaceConfig} interfaceConfigOverwrite: {...defaultInterfaceConfig, ...interfaceConfig}
}; };
if (!options.jwt) { if (!options.jwt) {