From ce89facd2d24fb1d7934c7efde7aeb2cd4e3df5e Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Mon, 13 Apr 2020 16:51:09 +0200 Subject: [PATCH] Improve method --- assets/js/components/calls/window.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/assets/js/components/calls/window.js b/assets/js/components/calls/window.js index 78150b50..81101571 100644 --- a/assets/js/components/calls/window.js +++ b/assets/js/components/calls/window.js @@ -673,14 +673,13 @@ class CallWindow extends CustomEvents { */ async startStreaming(includeVideo, shareScreen = false) { - let videoConstraints = this.conv.can_have_video_call && includeVideo; - let stream; // Get user screen if(includeVideo && shareScreen) { stream = await requestUserScreen(true) + // Ask for audio separatly const second_stream = await navigator.mediaDevices.getUserMedia({ audio: true }) @@ -692,7 +691,7 @@ class CallWindow extends CustomEvents { else { // First, query user media stream = await navigator.mediaDevices.getUserMedia({ - video: videoConstraints, + video: this.conv.can_have_video_call && includeVideo, audio: true, }) }