diff --git a/front/src/WebRtc/JitsiFactory.ts b/front/src/WebRtc/JitsiFactory.ts index 860c2919..35bc2c22 100644 --- a/front/src/WebRtc/JitsiFactory.ts +++ b/front/src/WebRtc/JitsiFactory.ts @@ -70,6 +70,7 @@ class JitsiFactory { private jitsiApi: any; // eslint-disable-line @typescript-eslint/no-explicit-any private audioCallback = this.onAudioChange.bind(this); private videoCallback = this.onVideoChange.bind(this); + private previousConfigMeet? : jitsiConfigInterface; /** * Slugifies the room name and prepends the room name with the instance @@ -79,6 +80,9 @@ class JitsiFactory { } public start(roomName: string, playerName:string, jwt?: string, config?: object, interfaceConfig?: object): void { + //save previous config + this.previousConfigMeet = getDefaultConfig(); + coWebsiteManager.insertCoWebsite((cowebsiteDiv => { // Jitsi meet external API maintains some data in local storage // which is sent via the appData URL parameter when joining a @@ -122,6 +126,19 @@ class JitsiFactory { this.jitsiApi.removeListener('audioMuteStatusChanged', this.audioCallback); this.jitsiApi.removeListener('videoMuteStatusChanged', this.videoCallback); this.jitsiApi?.dispose(); + + //restore previous config + if(this.previousConfigMeet?.startWithAudioMuted){ + mediaManager.disableMicrophone(); + }else{ + mediaManager.enableMicrophone(); + } + + if(this.previousConfigMeet?.startWithVideoMuted){ + mediaManager.disableCamera(); + }else{ + mediaManager.enableCamera(); + } } private onAudioChange({muted}: {muted: boolean}): void { diff --git a/maps/Floor0/floor0.json b/maps/Floor0/floor0.json index 6a88f78d..f5f2ee12 100644 --- a/maps/Floor0/floor0.json +++ b/maps/Floor0/floor0.json @@ -40,6 +40,11 @@ "name":"chillzone-2", "opacity":1, "properties":[ + { + "name":"jitsiConfig", + "type":"string", + "value":"{ \"startWithAudioMuted\": true, \"startWithVideoMuted\": true } " + }, { "name":"jitsiRoom", "type":"string", @@ -433,7 +438,7 @@ "nextobjectid":2, "orientation":"orthogonal", "renderorder":"right-down", - "tiledversion":"1.3.3", + "tiledversion":"1.4.3", "tileheight":32, "tilesets":[ { @@ -2379,6 +2384,6 @@ }], "tilewidth":32, "type":"map", - "version":1.2, + "version":1.4, "width":46 } \ No newline at end of file