mirror of https://github.com/OpenVidu/openvidu.git
Merge pull request #809 from semmel/patch-2
Fix Stream.isSendScreen() for custom videoSourcepull/816/head
commit
759b7b2a70
|
@ -790,12 +790,20 @@ export class Stream {
|
|||
* @hidden
|
||||
*/
|
||||
isSendScreen(): boolean {
|
||||
let screen = this.outboundStreamOpts.publisherProperties.videoSource === 'screen';
|
||||
if (platform.isElectron()) {
|
||||
let screen;
|
||||
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()) {
|
||||
screen =
|
||||
typeof this.outboundStreamOpts.publisherProperties.videoSource === 'string' &&
|
||||
this.outboundStreamOpts.publisherProperties.videoSource.startsWith('screen:');
|
||||
}
|
||||
else {
|
||||
screen = this.outboundStreamOpts.publisherProperties.videoSource === 'screen';
|
||||
}
|
||||
return !!this.outboundStreamOpts && screen;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue