From 90262099a37cafa991c84d3b5ed5fd29b85a062d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Mon, 26 Apr 2021 14:12:39 +0200 Subject: [PATCH] Fix initial camera quality MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a call started and the VideoConstrainer was created the video track was assumed to be already in high quality, so when the VideoConstrainer was asked to apply again the high quality constraints it just ignored the request. However, in some cases the browser does not initialize the camera in high quality, so the camera was kept in a lower quality for as long as the high quality was kept being requested. Moreover, even if the browser initialized the camera with high quality that quality might not be exactly the same as the one set when applying the high quality constraints, so even in those cases the constraints should be applied anyway for consistency. Signed-off-by: Daniel Calviño Sánchez --- src/utils/webrtc/VideoConstrainer.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/webrtc/VideoConstrainer.js b/src/utils/webrtc/VideoConstrainer.js index 1d4cadcdc60..cf43b81cb63 100644 --- a/src/utils/webrtc/VideoConstrainer.js +++ b/src/utils/webrtc/VideoConstrainer.js @@ -45,9 +45,9 @@ const QUALITY = { function VideoConstrainer(localMediaModel) { this._localMediaModel = localMediaModel - // By default the constraints used when getting the video try to get the - // highest quality - this._currentQuality = QUALITY.HIGH + // The current quality is undefined until the constraints are applied at + // least once. + this._currentQuality = undefined this._knownValidConstraintsForQuality = {} }