Skip to content

Commit 8a5c1dd

Browse files
fix(ScreenObtainer): allow Electron to use getDisplayMedia, hidden behind a flag for now (#2605)
1 parent 22daa35 commit 8a5c1dd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

modules/RTC/ScreenObtainer.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,13 @@ const ScreenObtainer = {
4646
* @private
4747
*/
4848
_createObtainStreamMethod() {
49-
if (browser.isElectron()) {
49+
const supportsGetDisplayMedia = browser.supportsGetDisplayMedia();
50+
51+
if (browser.isElectron() && !this.options.electronUseGetDisplayMedia) {
5052
return this.obtainScreenOnElectron;
51-
} else if (browser.isReactNative() && browser.supportsGetDisplayMedia()) {
53+
} else if (browser.isReactNative() && supportsGetDisplayMedia) {
5254
return this.obtainScreenFromGetDisplayMediaRN;
53-
} else if (browser.supportsGetDisplayMedia()) {
55+
} else if (supportsGetDisplayMedia) {
5456
return this.obtainScreenFromGetDisplayMedia;
5557
}
5658
logger.log('Screen sharing not supported on ', browser.getName());

0 commit comments

Comments
 (0)