From d26325d8dc9f0f1ec0618e7bab4fc41e373baacb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Wed, 15 Sep 2021 11:16:23 +0200 Subject: [PATCH] Fixing silent zone not respected when exiting Jitsi Now, when a silent zone is adjacent to a Jitsi, it is enforced, even after leaving the Jitsi zone --- front/src/Phaser/Game/GameScene.ts | 7 ++++--- maps/tests/index.html | 8 ++++++++ maps/tests/jitsi_custom_url.json | 17 +++++++++-------- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts index 39c87db7..ec387b4f 100644 --- a/front/src/Phaser/Game/GameScene.ts +++ b/front/src/Phaser/Game/GameScene.ts @@ -1807,17 +1807,18 @@ ${escapedMessage} mediaManager.hideGameOverlay(); //permit to stop jitsi when user close iframe - mediaManager.addTriggerCloseJitsiFrameButton("close-jisi", () => { + mediaManager.addTriggerCloseJitsiFrameButton("close-jitsi", () => { this.stopJitsi(); }); } public stopJitsi(): void { - this.connection?.setSilent(false); + const silent = this.gameMap.getCurrentProperties().get("silent"); + this.connection?.setSilent(!!silent); jitsiFactory.stop(); mediaManager.showGameOverlay(); - mediaManager.removeTriggerCloseJitsiFrameButton("close-jisi"); + mediaManager.removeTriggerCloseJitsiFrameButton("close-jitsi"); } //todo: put this into an 'orchestrator' scene (EntryScene?) diff --git a/maps/tests/index.html b/maps/tests/index.html index 29d4f0bb..09f6e54a 100644 --- a/maps/tests/index.html +++ b/maps/tests/index.html @@ -71,6 +71,14 @@ Testing audio layer + + + Success Failure Pending + + + Testing Jitsi + silent layer + +

Iframe API

diff --git a/maps/tests/jitsi_custom_url.json b/maps/tests/jitsi_custom_url.json index 855582ff..41da68f7 100644 --- a/maps/tests/jitsi_custom_url.json +++ b/maps/tests/jitsi_custom_url.json @@ -8,6 +8,12 @@ "id":1, "name":"floor", "opacity":1, + "properties":[ + { + "name":"silent", + "type":"bool", + "value":true + }], "type":"tilelayer", "visible":true, "width":10, @@ -37,11 +43,6 @@ "name":"jitsiRoom", "type":"string", "value":"myRoom" - }, - { - "name":"jitsiUrl", - "type":"string", - "value":"meet.jit.si" }], "type":"tilelayer", "visible":true, @@ -55,7 +56,7 @@ "name":"floorLayer", "objects":[ { - "height":94.6489098314831, + "height":163.652982988579, "id":1, "name":"", "properties":[ @@ -69,14 +70,14 @@ { "fontfamily":"Sans Serif", "pixelsize":8, - "text":"Test:\nWalk on the carpet and press space\nResult:\nJitsi opens on meet.jit.si (check this in the network tab). Note: this test only makes sense if the default configured Jitsi instance is NOT meet.jit.si (check your .env file)", + "text":"Test:\nThe whole map is silent.\nConnect with 2 users\nResult:\nThe map is silent\n\nTest:\nmove on the carpet with both users\n\nResult:\nA Jitsi opens\n\nTest:\nmove out of the carpet and try to connect both users\nResult:\nThey are still silent\n", "wrap":true }, "type":"", "visible":true, "width":317.361946929159, "x":2.32853056864467, - "y":224.602707451482 + "y":2.25624950083909 }], "opacity":1, "type":"objectgroup",