From cd7f8ae2828507d954cab209a53416b4ba479fa9 Mon Sep 17 00:00:00 2001 From: cruizba Date: Thu, 22 Jun 2023 11:45:40 +0200 Subject: [PATCH] Reformat of PR https://github.com/OpenVidu/openvidu/pull/809 --- openvidu-browser/src/OpenVidu/Stream.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/openvidu-browser/src/OpenVidu/Stream.ts b/openvidu-browser/src/OpenVidu/Stream.ts index 9b315da8..68bd3e47 100644 --- a/openvidu-browser/src/OpenVidu/Stream.ts +++ b/openvidu-browser/src/OpenVidu/Stream.ts @@ -790,18 +790,20 @@ export class Stream { * @hidden */ isSendScreen(): boolean { - let screen; + let screen = false if (typeof MediaStreamTrack !== 'undefined' && this.outboundStreamOpts.publisherProperties.videoSource instanceof MediaStreamTrack) { - var trackSettings = this.outboundStreamOpts.publisherProperties.videoSource.getSettings(); - screen = ["monitor", "window", "browser"].includes(trackSettings.displaySurface); - } - else if (platform.isElectron()) { + let trackSettings: any = this.outboundStreamOpts.publisherProperties.videoSource.getSettings(); + if (trackSettings.displaySurface) { + screen = ["monitor", "window", "browser"].includes(trackSettings.displaySurface); + } + } + if (!screen && platform.isElectron()) { screen = typeof this.outboundStreamOpts.publisherProperties.videoSource === 'string' && this.outboundStreamOpts.publisherProperties.videoSource.startsWith('screen:'); } - else { + if (!screen) { screen = this.outboundStreamOpts.publisherProperties.videoSource === 'screen'; } return !!this.outboundStreamOpts && screen;