fix(SS): Add toggle parameter
This commit is contained in:
parent
ff442853a2
commit
cfe7e30550
|
@ -1359,7 +1359,13 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Toggles between screensharing and camera video.
|
* Toggles between screen sharing and camera video if the toggle parameter
|
||||||
|
* is not specified and starts the procedure for obtaining new screen
|
||||||
|
* sharing/video track otherwise.
|
||||||
|
*
|
||||||
|
* @param {boolean} [toggle] - If true - new screen sharing track will be
|
||||||
|
* obtained. If false - new video track will be obtain. If not specified -
|
||||||
|
* toggles between screen sharing and camera video.
|
||||||
* @param {Object} [options] - Screen sharing options that will be passed to
|
* @param {Object} [options] - Screen sharing options that will be passed to
|
||||||
* createLocalTracks.
|
* createLocalTracks.
|
||||||
* @param {Array<string>} [options.desktopSharingSources] - Array with the
|
* @param {Array<string>} [options.desktopSharingSources] - Array with the
|
||||||
|
@ -1367,7 +1373,7 @@ export default {
|
||||||
* 'window', etc.).
|
* 'window', etc.).
|
||||||
* @return {Promise.<T>}
|
* @return {Promise.<T>}
|
||||||
*/
|
*/
|
||||||
toggleScreenSharing(options = {}) {
|
toggleScreenSharing(toggle = !this._untoggleScreenSharing, options = {}) {
|
||||||
if (this.videoSwitchInProgress) {
|
if (this.videoSwitchInProgress) {
|
||||||
return Promise.reject('Switch in progress.');
|
return Promise.reject('Switch in progress.');
|
||||||
}
|
}
|
||||||
|
@ -1382,7 +1388,7 @@ export default {
|
||||||
return Promise.reject('No screensharing in audio only mode');
|
return Promise.reject('No screensharing in audio only mode');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this._untoggleScreenSharing) {
|
if (toggle) {
|
||||||
return this._switchToScreenSharing(options);
|
return this._switchToScreenSharing(options);
|
||||||
} else {
|
} else {
|
||||||
return this._untoggleScreenSharing();
|
return this._untoggleScreenSharing();
|
||||||
|
|
Loading…
Reference in New Issue