From 00f82fce76443e60f89144df11e758a075f52d23 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sun, 31 Jan 2021 05:29:49 +0100 Subject: [PATCH] Do not proxy streaming images by default --- assets/js/components/calls/window.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/assets/js/components/calls/window.js b/assets/js/components/calls/window.js index 42d84d99..d30604a9 100644 --- a/assets/js/components/calls/window.js +++ b/assets/js/components/calls/window.js @@ -232,7 +232,7 @@ class CallWindow extends CustomEvents { text: "Toggle blur background", needVideo: true, onclick: () => { - this.blurBackground = !this.blurBackground; + this.toggleBlurBackground() } }, @@ -657,6 +657,17 @@ class CallWindow extends CustomEvents { }; } + /** + * Toggle blur background mode + */ + toggleBlurBackground() { + this.blurBackground = !this.blurBackground; + + // Check if background blur network is loaded + if(!this.backgroundDetectionNetwork) + notify("Please stop and start streaming again to apply modification!"); + } + /** * Toggle stream state * @@ -936,7 +947,7 @@ class CallWindow extends CustomEvents { return // If streaming video stream, allow to blur background - if(includeVideo) + if(includeVideo && this.blurBackground) { // Create capture const videoTarget = document.createElement("video"); @@ -1005,7 +1016,7 @@ class CallWindow extends CustomEvents { })(); - stream = canvasTarget.captureStream(); + stream = canvasTarget.captureStream(24); stream.addTrack(this.mainStream.getAudioTracks()[0]); }