From 469cac9656805199d62d65bf382d7377276685df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Fri, 4 Jun 2021 16:08:02 +0200 Subject: [PATCH] Making sure the "stopped screensharing" log is not displayed on startup --- front/src/WebRtc/MediaManager.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/front/src/WebRtc/MediaManager.ts b/front/src/WebRtc/MediaManager.ts index 8292b0ad..efc9660a 100644 --- a/front/src/WebRtc/MediaManager.ts +++ b/front/src/WebRtc/MediaManager.ts @@ -65,6 +65,7 @@ export class MediaManager { } }); + let isScreenSharing = false; screenSharingLocalStreamStore.subscribe((result) => { if (result.type === 'error') { console.error(result.error); @@ -75,10 +76,14 @@ export class MediaManager { } if (result.stream !== null) { + isScreenSharing = true; this.addScreenSharingActiveVideo('me', DivImportance.Normal); HtmlUtils.getElementByIdOrFail('screen-sharing-me').srcObject = result.stream; } else { - this.removeActiveScreenSharingVideo('me'); + if (isScreenSharing) { + isScreenSharing = false; + this.removeActiveScreenSharingVideo('me'); + } } });