From 2c6de02f1ca1b1e0bbf0a2883bc729723b732493 Mon Sep 17 00:00:00 2001 From: prlanzarin <4529051+prlanzarin@users.noreply.github.com> Date: Fri, 2 Aug 2024 13:09:42 -0300 Subject: [PATCH] fix(video): webcam fails to be loaded on preview when changing profiles There's an issue where permission-less sessions of video-preview fail to change video profiles. Whenever gUM is on prompt mode, deviceIds are obfuscated, which means getInitialCamera will need to infer the deviceId based on the current media stream. Since the virtual bg worker is now called synchronously (e28a595), it'll be extracted incorrectly from the virtual effect MediaStream (rather than the original stream) - which causes getInitialCamera to use the effect's deviceId rather than the original stream's deviceId. Guarantee that deviceId inference via MediaStreamTrack uses BBBVideoStream's originalStream (so that virtual effect streams are bypassed). Also remove the call to updateDeviceId in getInitialCamera since it's redundant since commit e28a595. --- .../imports/ui/components/video-preview/component.jsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bigbluebutton-html5/imports/ui/components/video-preview/component.jsx b/bigbluebutton-html5/imports/ui/components/video-preview/component.jsx index 4649c23e85..bab7f8e2f7 100755 --- a/bigbluebutton-html5/imports/ui/components/video-preview/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/video-preview/component.jsx @@ -646,7 +646,7 @@ class VideoPreview extends Component { if (!actualDeviceId && this.currentVideoStream) { actualDeviceId = MediaStreamUtils.extractDeviceIdFromStream( - this.currentVideoStream.mediaStream, + this.currentVideoStream.originalStream, 'video', ); } @@ -660,9 +660,7 @@ class VideoPreview extends Component { ? PreviewService.getDefaultProfile() : PreviewService.getCameraAsContentProfile(); - return this.getCameraStream(deviceId, defaultProfile).then(() => { - this.updateDeviceId(deviceId); - }); + return this.getCameraStream(deviceId, defaultProfile); } async startEffects(deviceId) {