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
|
* @hidden
|
||||||
*/
|
*/
|
||||||
isSendScreen(): boolean {
|
isSendScreen(): boolean {
|
||||||
let screen = this.outboundStreamOpts.publisherProperties.videoSource === 'screen';
|
let screen;
|
||||||
if (platform.isElectron()) {
|
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 =
|
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 {
|
||||||
|
screen = this.outboundStreamOpts.publisherProperties.videoSource === 'screen';
|
||||||
|
}
|
||||||
return !!this.outboundStreamOpts && screen;
|
return !!this.outboundStreamOpts && screen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue