From f70ba1411a99568f87c5b2b7a19adf0b2bb99f69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Tue, 1 Sep 2020 14:43:21 +0200 Subject: [PATCH] Hiding cam details when entering a Jisti room --- front/src/Phaser/Game/GameScene.ts | 3 +++ front/src/WebRtc/MediaManager.ts | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts index a17eab22..5ea28b99 100644 --- a/front/src/Phaser/Game/GameScene.ts +++ b/front/src/Phaser/Game/GameScene.ts @@ -30,6 +30,7 @@ import GameObject = Phaser.GameObjects.GameObject; import FILE_LOAD_ERROR = Phaser.Loader.Events.FILE_LOAD_ERROR; import {GameMap} from "./GameMap"; import {CoWebsiteManager} from "../../WebRtc/CoWebsiteManager"; +import {mediaManager} from "../../WebRtc/MediaManager"; export enum Textures { @@ -429,6 +430,7 @@ export class GameScene extends Phaser.Scene implements CenterListener { this.connection.setSilent(false); jitsiApi?.dispose(); CoWebsiteManager.closeCoWebsite(); + mediaManager.showGameOverlay(); } else { CoWebsiteManager.insertCoWebsite((cowebsiteDiv => { const domain = JITSI_URL; @@ -449,6 +451,7 @@ export class GameScene extends Phaser.Scene implements CenterListener { jitsiApi.executeCommand('displayName', gameManager.getPlayerName()); })); this.connection.setSilent(true); + mediaManager.hideGameOverlay(); } }) diff --git a/front/src/WebRtc/MediaManager.ts b/front/src/WebRtc/MediaManager.ts index e8cb080d..153d660b 100644 --- a/front/src/WebRtc/MediaManager.ts +++ b/front/src/WebRtc/MediaManager.ts @@ -132,6 +132,11 @@ export class MediaManager { gameOverlay.classList.add('active'); } + public hideGameOverlay(){ + const gameOverlay = this.getElementByIdOrFail('game-overlay'); + gameOverlay.classList.remove('active'); + } + private enableCamera() { this.cinemaClose.style.display = "none"; this.cinemaBtn.classList.remove("disabled");