fix: incompatible effect instance (#10311)

There are hard to handle race conditions around
screensharing/presenter mode turning on/off. It's
easier to make a NO-OP for turning the camera on/off
while switching to screen sharing is in progress
than trying to handle this gracefully. It should be okay
for the user to click the button again after the switch
operation is done.

Ideally this logic will be re-implemented in redux
middlewares and moved out of the conference.js file.
This commit is contained in:
Paweł Domas 2021-11-08 14:05:23 -06:00 committed by GitHub
parent b2894cc941
commit 6a7842ab7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -1015,6 +1015,14 @@ export default {
* dialogs in case of media permissions error.
*/
muteVideo(mute, showUI = true) {
if (this.videoSwitchInProgress) {
// Turning the camera on while the screen sharing mode is being turned off is causing issues around
// the presenter mode handling. It should be okay for the user to click the button again once that's done.
console.warn('muteVideo - unable to perform operations while video switch is in progress');
return;
}
if (!mute
&& isUserInteractionRequiredForUnmute(APP.store.getState())) {
logger.error('Unmuting video requires user interaction');
@ -1644,7 +1652,7 @@ export default {
async toggleScreenSharing(toggle = !this._untoggleScreenSharing, options = {}, ignoreDidHaveVideo) {
logger.debug(`toggleScreenSharing: ${toggle}`);
if (this.videoSwitchInProgress) {
return Promise.reject('Switch in progress.');
return Promise.reject(`toggleScreenSharing: ${toggle} aborted - video switch in progress.`);
}
if (!JitsiMeetJS.isDesktopSharingEnabled()) {
return Promise.reject('Cannot toggle screen sharing: not supported.');