cruizba 2023-06-22 11:45:40 +02:00
parent 759b7b2a70
commit cd7f8ae282
1 changed files with 8 additions and 6 deletions

View File

@ -790,18 +790,20 @@ export class Stream {
* @hidden * @hidden
*/ */
isSendScreen(): boolean { isSendScreen(): boolean {
let screen; let screen = false
if (typeof MediaStreamTrack !== 'undefined' && if (typeof MediaStreamTrack !== 'undefined' &&
this.outboundStreamOpts.publisherProperties.videoSource instanceof MediaStreamTrack) { this.outboundStreamOpts.publisherProperties.videoSource instanceof MediaStreamTrack) {
var trackSettings = this.outboundStreamOpts.publisherProperties.videoSource.getSettings(); let trackSettings: any = this.outboundStreamOpts.publisherProperties.videoSource.getSettings();
screen = ["monitor", "window", "browser"].includes(trackSettings.displaySurface); if (trackSettings.displaySurface) {
} screen = ["monitor", "window", "browser"].includes(trackSettings.displaySurface);
else if (platform.isElectron()) { }
}
if (!screen && platform.isElectron()) {
screen = screen =
typeof this.outboundStreamOpts.publisherProperties.videoSource === 'string' && typeof this.outboundStreamOpts.publisherProperties.videoSource === 'string' &&
this.outboundStreamOpts.publisherProperties.videoSource.startsWith('screen:'); this.outboundStreamOpts.publisherProperties.videoSource.startsWith('screen:');
} }
else { if (!screen) {
screen = this.outboundStreamOpts.publisherProperties.videoSource === 'screen'; screen = this.outboundStreamOpts.publisherProperties.videoSource === 'screen';
} }
return !!this.outboundStreamOpts && screen; return !!this.outboundStreamOpts && screen;