feat(screenshare) Allow desktop sharing in audioOnly mode on web.

This is already supported on mobile. The user is allowed to enable their video in audioOnly mode so it doesn't make sense to block screenshare.
This commit is contained in:
Shahab 2022-02-28 19:15:24 +03:30 committed by GitHub
parent 06800f88bf
commit f62dc44f3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -1661,9 +1661,12 @@ export default {
* toggles between screen sharing and camera video.
* @param {Object} [options] - Screen sharing options that will be passed to
* createLocalTracks.
* @param {boolean} [options.audioOnly] - Whether or not audioOnly is enabled.
* @param {Array<string>} [options.desktopSharingSources] - Array with the
* sources that have to be displayed in the desktop picker window ('screen',
* 'window', etc.).
* @param {Object} [options.desktopStream] - An existing desktop stream to
* use instead of creating a new desktop stream.
* @param {boolean} ignoreDidHaveVideo - if true ignore if video was on when sharing started.
* @return {Promise.<T>}
*/
@ -1676,10 +1679,6 @@ export default {
return Promise.reject('Cannot toggle screen sharing: not supported.');
}
if (this.isAudioOnly()) {
return Promise.reject('No screensharing in audio only mode');
}
if (toggle) {
try {
await this._switchToScreenSharing(options);