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
This commit is contained in:
David Négrier 2021-09-15 11:16:23 +02:00
parent 01bd36ca3f
commit d26325d8dc
3 changed files with 21 additions and 11 deletions

View File

@ -1807,17 +1807,18 @@ ${escapedMessage}
mediaManager.hideGameOverlay(); mediaManager.hideGameOverlay();
//permit to stop jitsi when user close iframe //permit to stop jitsi when user close iframe
mediaManager.addTriggerCloseJitsiFrameButton("close-jisi", () => { mediaManager.addTriggerCloseJitsiFrameButton("close-jitsi", () => {
this.stopJitsi(); this.stopJitsi();
}); });
} }
public stopJitsi(): void { public stopJitsi(): void {
this.connection?.setSilent(false); const silent = this.gameMap.getCurrentProperties().get("silent");
this.connection?.setSilent(!!silent);
jitsiFactory.stop(); jitsiFactory.stop();
mediaManager.showGameOverlay(); mediaManager.showGameOverlay();
mediaManager.removeTriggerCloseJitsiFrameButton("close-jisi"); mediaManager.removeTriggerCloseJitsiFrameButton("close-jitsi");
} }
//todo: put this into an 'orchestrator' scene (EntryScene?) //todo: put this into an 'orchestrator' scene (EntryScene?)

View File

@ -71,6 +71,14 @@
<a href="#" class="testLink" data-testmap="audio.json" target="_blank">Testing audio layer</a> <a href="#" class="testLink" data-testmap="audio.json" target="_blank">Testing audio layer</a>
</td> </td>
</tr> </tr>
<tr>
<td>
<input type="radio" name="test-jitsi-silent"> Success <input type="radio" name="test-jitsi-silent"> Failure <input type="radio" name="test-jitsi-silent" checked> Pending
</td>
<td>
<a href="#" class="testLink" data-testmap="jitsi_custom_url.json" target="_blank">Testing Jitsi + silent layer</a>
</td>
</tr>
</table> </table>
<h2>Iframe API</h2> <h2>Iframe API</h2>
<table class="table"> <table class="table">

View File

@ -8,6 +8,12 @@
"id":1, "id":1,
"name":"floor", "name":"floor",
"opacity":1, "opacity":1,
"properties":[
{
"name":"silent",
"type":"bool",
"value":true
}],
"type":"tilelayer", "type":"tilelayer",
"visible":true, "visible":true,
"width":10, "width":10,
@ -37,11 +43,6 @@
"name":"jitsiRoom", "name":"jitsiRoom",
"type":"string", "type":"string",
"value":"myRoom" "value":"myRoom"
},
{
"name":"jitsiUrl",
"type":"string",
"value":"meet.jit.si"
}], }],
"type":"tilelayer", "type":"tilelayer",
"visible":true, "visible":true,
@ -55,7 +56,7 @@
"name":"floorLayer", "name":"floorLayer",
"objects":[ "objects":[
{ {
"height":94.6489098314831, "height":163.652982988579,
"id":1, "id":1,
"name":"", "name":"",
"properties":[ "properties":[
@ -69,14 +70,14 @@
{ {
"fontfamily":"Sans Serif", "fontfamily":"Sans Serif",
"pixelsize":8, "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 "wrap":true
}, },
"type":"", "type":"",
"visible":true, "visible":true,
"width":317.361946929159, "width":317.361946929159,
"x":2.32853056864467, "x":2.32853056864467,
"y":224.602707451482 "y":2.25624950083909
}], }],
"opacity":1, "opacity":1,
"type":"objectgroup", "type":"objectgroup",