|
|
@@ -443,11 +443,12 @@ class RTCUtils extends Listenable {
|
|
443
|
443
|
* logic compared to use screenObtainer versus normal device capture logic
|
|
444
|
444
|
* in RTCUtils#_getUserMedia.
|
|
445
|
445
|
*
|
|
|
446
|
+ * @param {Object} options - Optional parameters.
|
|
446
|
447
|
* @returns {Promise} A promise which will be resolved with an object which
|
|
447
|
448
|
* contains the acquired display stream. If desktop sharing is not supported
|
|
448
|
449
|
* then a rejected promise will be returned.
|
|
449
|
450
|
*/
|
|
450
|
|
- _getDesktopMedia() {
|
|
|
451
|
+ _getDesktopMedia(options) {
|
|
451
|
452
|
if (!screenObtainer.isSupported()) {
|
|
452
|
453
|
return Promise.reject(new Error('Desktop sharing is not supported!'));
|
|
453
|
454
|
}
|
|
|
@@ -459,7 +460,8 @@ class RTCUtils extends Listenable {
|
|
459
|
460
|
},
|
|
460
|
461
|
error => {
|
|
461
|
462
|
reject(error);
|
|
462
|
|
- });
|
|
|
463
|
+ },
|
|
|
464
|
+ options);
|
|
463
|
465
|
});
|
|
464
|
466
|
}
|
|
465
|
467
|
|
|
|
@@ -509,6 +511,8 @@ class RTCUtils extends Listenable {
|
|
509
|
511
|
* @param {Object} options.desktopSharingFrameRate.max - Maximum fps
|
|
510
|
512
|
* @param {String} options.desktopSharingSourceDevice - The device id or
|
|
511
|
513
|
* label for a video input source that should be used for screensharing.
|
|
|
514
|
+ * @param {Array<string>} options.desktopSharingSources - The types of sources ("screen", "window", etc)
|
|
|
515
|
+ * from which the user can select what to share.
|
|
512
|
516
|
* @returns {Promise} The promise, when successful, will return an array of
|
|
513
|
517
|
* meta data for the requested device type, which includes the stream and
|
|
514
|
518
|
* track. If an error occurs, it will be deferred to the caller for
|
|
|
@@ -542,7 +546,8 @@ class RTCUtils extends Listenable {
|
|
542
|
546
|
}
|
|
543
|
547
|
|
|
544
|
548
|
const {
|
|
545
|
|
- desktopSharingSourceDevice
|
|
|
549
|
+ desktopSharingSourceDevice,
|
|
|
550
|
+ desktopSharingSources
|
|
546
|
551
|
} = otherOptions;
|
|
547
|
552
|
|
|
548
|
553
|
// Attempt to use a video input device as a screenshare source if
|
|
|
@@ -580,7 +585,7 @@ class RTCUtils extends Listenable {
|
|
580
|
585
|
});
|
|
581
|
586
|
}
|
|
582
|
587
|
|
|
583
|
|
- return this._getDesktopMedia();
|
|
|
588
|
+ return this._getDesktopMedia({ desktopSharingSources });
|
|
584
|
589
|
}.bind(this);
|
|
585
|
590
|
|
|
586
|
591
|
/**
|