Jitsi config properties
This commit is contained in:
parent
adb535d1b6
commit
9c4d0aa32f
@ -669,6 +669,12 @@ export class GameScene extends ResizableScene implements CenterListener {
|
|||||||
|
|
||||||
this.connection.emitQueryJitsiJwtMessage(this.instance.replace('/', '-') + "-" + newValue, adminTag);
|
this.connection.emitQueryJitsiJwtMessage(this.instance.replace('/', '-') + "-" + newValue, adminTag);
|
||||||
} else {
|
} else {
|
||||||
|
const jitsiConfig = allProps.get("jitsiConfig") as string|undefined;
|
||||||
|
jitsiFactory.setJitsiConfig(jitsiConfig || undefined);
|
||||||
|
|
||||||
|
const jitsiInterfaceConfig = allProps.get("jitsiInterfaceConfig") as string|undefined;
|
||||||
|
jitsiFactory.setJitsiInterfaceConfig(jitsiInterfaceConfig || undefined);
|
||||||
|
|
||||||
this.startJitsi(newValue as string);
|
this.startJitsi(newValue as string);
|
||||||
}
|
}
|
||||||
layoutManager.removeActionButton('jitsiRoom', this.userInputManager);
|
layoutManager.removeActionButton('jitsiRoom', this.userInputManager);
|
||||||
|
@ -3,6 +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 config = {
|
||||||
|
startWithAudioMuted: !mediaManager.constraintsMedia.audio,
|
||||||
|
startWithVideoMuted: mediaManager.constraintsMedia.video === false,
|
||||||
|
prejoinPageEnabled: false
|
||||||
|
}
|
||||||
|
|
||||||
const interfaceConfig = {
|
const interfaceConfig = {
|
||||||
SHOW_CHROME_EXTENSION_BANNER: false,
|
SHOW_CHROME_EXTENSION_BANNER: false,
|
||||||
MOBILE_APP_PROMO: false,
|
MOBILE_APP_PROMO: false,
|
||||||
@ -26,6 +32,8 @@ const interfaceConfig = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
class JitsiFactory {
|
class JitsiFactory {
|
||||||
|
public jitsiConfig: object = config;
|
||||||
|
public jitsiInterfaceConfig: object = interfaceConfig;
|
||||||
private jitsiApi: any; // eslint-disable-line @typescript-eslint/no-explicit-any
|
private jitsiApi: any; // eslint-disable-line @typescript-eslint/no-explicit-any
|
||||||
private audioCallback = this.onAudioChange.bind(this);
|
private audioCallback = this.onAudioChange.bind(this);
|
||||||
private videoCallback = this.onVideoChange.bind(this);
|
private videoCallback = this.onVideoChange.bind(this);
|
||||||
@ -39,12 +47,8 @@ class JitsiFactory {
|
|||||||
width: "100%",
|
width: "100%",
|
||||||
height: "100%",
|
height: "100%",
|
||||||
parentNode: cowebsiteDiv,
|
parentNode: cowebsiteDiv,
|
||||||
configOverwrite: {
|
configOverwrite: this.jitsiConfig,
|
||||||
startWithAudioMuted: !mediaManager.constraintsMedia.audio,
|
interfaceConfigOverwrite: this.jitsiInterfaceConfig
|
||||||
startWithVideoMuted: mediaManager.constraintsMedia.video === false,
|
|
||||||
prejoinPageEnabled: false
|
|
||||||
},
|
|
||||||
interfaceConfigOverwrite: interfaceConfig,
|
|
||||||
};
|
};
|
||||||
if (!options.jwt) {
|
if (!options.jwt) {
|
||||||
delete options.jwt;
|
delete options.jwt;
|
||||||
@ -88,6 +92,33 @@ class JitsiFactory {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public setJitsiConfig(jitsiConfig: string|undefined): void {
|
||||||
|
if(jitsiConfig) {
|
||||||
|
try {
|
||||||
|
const parsedConfig = JSON.parse(jitsiConfig);
|
||||||
|
this.jitsiConfig = {...config, ...parsedConfig};
|
||||||
|
} catch (e) {
|
||||||
|
console.warn('jitsiConfig', e);
|
||||||
|
this.jitsiConfig = config;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.jitsiConfig = config;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public setJitsiInterfaceConfig(jitsiInterfaceConfig: string|undefined): void {
|
||||||
|
if(jitsiInterfaceConfig) {
|
||||||
|
try {
|
||||||
|
const parsedInterfaceConfig = JSON.parse(jitsiInterfaceConfig);
|
||||||
|
this.jitsiInterfaceConfig = {...interfaceConfig, ...parsedInterfaceConfig};
|
||||||
|
} catch (e) {
|
||||||
|
console.warn('jitsiInterfaceConfig', e);
|
||||||
|
this.jitsiInterfaceConfig = interfaceConfig;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.jitsiInterfaceConfig = interfaceConfig;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const jitsiFactory = new JitsiFactory();
|
export const jitsiFactory = new JitsiFactory();
|
Loading…
x
Reference in New Issue
Block a user