Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

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

Дамян Минковca259287be76
diff --git a/react/features/base/conference/middleware.web.js b/react/features/base/conference/middleware.web.js
index bc40230c53..354acb8112 100644
--- a/react/features/base/conference/middleware.web.js
+++ b/react/features/base/conference/middleware.web.js
@@ -1,8 +1,15 @@
// @flow
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 { showNotification, NOTIFICATION_TIMEOUT_TYPE } from '../../notifications';
+import {
+ showNotification,
+ NOTIFICATION_TIMEOUT_TYPE,
+ isModerationNotificationDisplayed
+} from '../../notifications';
import {
setPrejoinPageVisibility,
setSkipPrejoinOnReload
@@ -61,12 +68,33 @@ MiddlewareRegistry.register(store => next => action => {
break;
}
- case TOGGLE_SCREENSHARING: {
- getMultipleVideoSendingSupportFeatureFlag(getState()) && _toggleScreenSharing(action, store);
+ 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())) {
+ _toggleScreenSharing(action, store);
+ } else {
+ APP.UI.emitEvent(UIEvents.TOGGLE_SCREENSHARING,
+ {
+ enabled,
+ audioOnly,
+ ignoreDidHaveVideo
+ });
+ }
+ }
break;
}
- }
return next(action);
});
diff --git a/react/features/base/tracks/middleware.js b/react/features/base/tracks/middleware.js
index 4a93306210..ea13532568 100644
--- a/react/features/base/tracks/middleware.js
+++ b/react/features/base/tracks/middleware.js
@@ -2,11 +2,8 @@
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 { hideNotification, isModerationNotificationDisplayed } from '../../notifications';
+import { hideNotification } from '../../notifications';
import { isPrejoinPageVisible } from '../../prejoin/functions';
import { getCurrentConference } from '../conference/functions';
import { getMultipleVideoSendingSupportFeatureFlag } from '../config';
@@ -28,7 +25,6 @@ import {
import { MiddlewareRegistry, StateListenerRegistry } from '../redux';
import {
- TOGGLE_SCREENSHARING,
TRACK_ADDED,
TRACK_MUTE_UNMUTE_FAILED,
TRACK_NO_DATA_FROM_SOURCE,
@@ -157,31 +153,6 @@ MiddlewareRegistry.register(store => next => action => {
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: {
const { jitsiTrack } = action.track;
const muted = action.wasMuted;