fix: Applies AV moderation checks on screen sharing with multistream on.

Guests trying to screenshare see the notification but also the dialog for choosing content.
This commit is contained in:
Дамян Минков 2022-08-04 12:41:02 +03:00
parent 5601a62b60
commit ca259287be
2 changed files with 33 additions and 34 deletions

View File

@ -1,8 +1,15 @@
// @flow // @flow
import { AUDIO_ONLY_SCREEN_SHARE_NO_TRACK } from '../../../../modules/UI/UIErrors'; import { AUDIO_ONLY_SCREEN_SHARE_NO_TRACK } from '../../../../modules/UI/UIErrors';
import UIEvents from '../../../../service/UI/UIEvents';
import { showModeratedNotification } from '../../av-moderation/actions';
import { shouldShowModeratedNotification } from '../../av-moderation/functions';
import { setNoiseSuppressionEnabled } from '../../noise-suppression/actions'; import { setNoiseSuppressionEnabled } from '../../noise-suppression/actions';
import { showNotification, NOTIFICATION_TIMEOUT_TYPE } from '../../notifications'; import {
showNotification,
NOTIFICATION_TIMEOUT_TYPE,
isModerationNotificationDisplayed
} from '../../notifications';
import { import {
setPrejoinPageVisibility, setPrejoinPageVisibility,
setSkipPrejoinOnReload setSkipPrejoinOnReload
@ -61,11 +68,32 @@ MiddlewareRegistry.register(store => next => action => {
break; break;
} }
case TOGGLE_SCREENSHARING: { case TOGGLE_SCREENSHARING:
getMultipleVideoSendingSupportFeatureFlag(getState()) && _toggleScreenSharing(action, store); if (typeof APP === 'object') {
// check for A/V Moderation when trying to start screen sharing
break; if ((action.enabled || action.enabled === undefined)
&& shouldShowModeratedNotification(MEDIA_TYPE.VIDEO, store.getState())) {
if (!isModerationNotificationDisplayed(MEDIA_TYPE.PRESENTER, store.getState())) {
store.dispatch(showModeratedNotification(MEDIA_TYPE.PRESENTER));
} }
return;
}
const { enabled, audioOnly, ignoreDidHaveVideo } = action;
if (getMultipleVideoSendingSupportFeatureFlag(store.getState())) {
_toggleScreenSharing(action, store);
} else {
APP.UI.emitEvent(UIEvents.TOGGLE_SCREENSHARING,
{
enabled,
audioOnly,
ignoreDidHaveVideo
});
}
}
break;
} }
return next(action); return next(action);

View File

@ -2,11 +2,8 @@
import { batch } from 'react-redux'; import { batch } from 'react-redux';
import UIEvents from '../../../../service/UI/UIEvents';
import { showModeratedNotification } from '../../av-moderation/actions';
import { shouldShowModeratedNotification } from '../../av-moderation/functions';
import { _RESET_BREAKOUT_ROOMS } from '../../breakout-rooms/actionTypes'; import { _RESET_BREAKOUT_ROOMS } from '../../breakout-rooms/actionTypes';
import { hideNotification, isModerationNotificationDisplayed } from '../../notifications'; import { hideNotification } from '../../notifications';
import { isPrejoinPageVisible } from '../../prejoin/functions'; import { isPrejoinPageVisible } from '../../prejoin/functions';
import { getCurrentConference } from '../conference/functions'; import { getCurrentConference } from '../conference/functions';
import { getMultipleVideoSendingSupportFeatureFlag } from '../config'; import { getMultipleVideoSendingSupportFeatureFlag } from '../config';
@ -28,7 +25,6 @@ import {
import { MiddlewareRegistry, StateListenerRegistry } from '../redux'; import { MiddlewareRegistry, StateListenerRegistry } from '../redux';
import { import {
TOGGLE_SCREENSHARING,
TRACK_ADDED, TRACK_ADDED,
TRACK_MUTE_UNMUTE_FAILED, TRACK_MUTE_UNMUTE_FAILED,
TRACK_NO_DATA_FROM_SOURCE, TRACK_NO_DATA_FROM_SOURCE,
@ -157,31 +153,6 @@ MiddlewareRegistry.register(store => next => action => {
break; break;
} }
case TOGGLE_SCREENSHARING:
if (typeof APP === 'object') {
// check for A/V Moderation when trying to start screen sharing
if ((action.enabled || action.enabled === undefined)
&& shouldShowModeratedNotification(MEDIA_TYPE.VIDEO, store.getState())) {
if (!isModerationNotificationDisplayed(MEDIA_TYPE.PRESENTER, store.getState())) {
store.dispatch(showModeratedNotification(MEDIA_TYPE.PRESENTER));
}
return;
}
const { enabled, audioOnly, ignoreDidHaveVideo } = action;
if (!getMultipleVideoSendingSupportFeatureFlag(store.getState())) {
APP.UI.emitEvent(UIEvents.TOGGLE_SCREENSHARING,
{
enabled,
audioOnly,
ignoreDidHaveVideo
});
}
}
break;
case TRACK_MUTE_UNMUTE_FAILED: { case TRACK_MUTE_UNMUTE_FAILED: {
const { jitsiTrack } = action.track; const { jitsiTrack } = action.track;
const muted = action.wasMuted; const muted = action.wasMuted;