From 384fe52bd697629d51e70e5610dee2c074760ebb Mon Sep 17 00:00:00 2001 From: TCGBOGA Date: Wed, 22 Nov 2023 11:16:28 +0100 Subject: [PATCH 1/2] fix: screenshare with audio blinking problem fixed. BM-0000 --- modules/RTC/ScreenObtainer.js | 39 +++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/modules/RTC/ScreenObtainer.js b/modules/RTC/ScreenObtainer.js index b6b408a8..dde1006d 100644 --- a/modules/RTC/ScreenObtainer.js +++ b/modules/RTC/ScreenObtainer.js @@ -138,6 +138,21 @@ const ScreenObtainer = { (streamId, streamType, screenShareAudio = false) => { if (streamId) { let audioConstraints = false; + let constraints = { + audio: audioConstraints, + video: { + mandatory: { + chromeMediaSource: 'desktop', + chromeMediaSourceId: streamId, + minFrameRate: desktopSharingFrameRate?.min ?? SS_DEFAULT_FRAME_RATE, + maxFrameRate: desktopSharingFrameRate?.max ?? SS_DEFAULT_FRAME_RATE, + minWidth: desktopSharingResolution?.width?.min, + minHeight: desktopSharingResolution?.height?.min, + maxWidth: desktopSharingResolution?.width?.max ?? window.screen.width, + maxHeight: desktopSharingResolution?.height?.max ?? window.screen.height + } + } + }; if (screenShareAudio) { audioConstraints = {}; @@ -161,23 +176,17 @@ const ScreenObtainer = { echoCancellation: true }; } - } - const constraints = { - audio: audioConstraints, - video: { - mandatory: { - chromeMediaSource: 'desktop', - chromeMediaSourceId: streamId, - minFrameRate: desktopSharingFrameRate?.min ?? SS_DEFAULT_FRAME_RATE, - maxFrameRate: desktopSharingFrameRate?.max ?? SS_DEFAULT_FRAME_RATE, - minWidth: desktopSharingResolution?.width?.min, - minHeight: desktopSharingResolution?.height?.min, - maxWidth: desktopSharingResolution?.width?.max ?? window.screen.width, - maxHeight: desktopSharingResolution?.height?.max ?? window.screen.height + + constraints = { + audio: audioConstraints, + video: { + mandatory: { + chromeMediaSource: 'desktop' + } } - } - }; + }; + } // We have to use the old API on Electron to get a desktop stream. navigator.mediaDevices.getUserMedia(constraints) From 35d62a9de8c649ae40e349c1c377bd4ca7023536 Mon Sep 17 00:00:00 2001 From: TCGBOGA Date: Fri, 24 Nov 2023 07:48:15 +0100 Subject: [PATCH 2/2] fix: video contstrains with streamId and without framerate parameters. BM-3557 --- modules/RTC/ScreenObtainer.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/RTC/ScreenObtainer.js b/modules/RTC/ScreenObtainer.js index dde1006d..9cc9ae92 100644 --- a/modules/RTC/ScreenObtainer.js +++ b/modules/RTC/ScreenObtainer.js @@ -182,7 +182,8 @@ const ScreenObtainer = { audio: audioConstraints, video: { mandatory: { - chromeMediaSource: 'desktop' + chromeMediaSource: 'desktop', + chromeMediaSourceId: streamId } } };