From 76fc5a0806b0e7f699076bfd3b1008ce47b45d71 Mon Sep 17 00:00:00 2001 From: robertpin Date: Wed, 27 Oct 2021 12:37:23 +0300 Subject: [PATCH] fix(av-moderation) Stop screensharing on video mute on native When the moderator stops the video for the participant stop screensharing (removes the track doesn't just mute it) --- react/features/base/tracks/middleware.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/react/features/base/tracks/middleware.js b/react/features/base/tracks/middleware.js index bab90bbc2..5de85954a 100644 --- a/react/features/base/tracks/middleware.js +++ b/react/features/base/tracks/middleware.js @@ -158,7 +158,7 @@ MiddlewareRegistry.register(store => next => action => { } break; - case TRACK_UPDATED: + case TRACK_UPDATED: { // TODO Remove the following calls to APP.UI once components interested // in track mute changes are moved into React and/or redux. if (typeof APP !== 'undefined') { @@ -192,7 +192,14 @@ MiddlewareRegistry.register(store => next => action => { return result; } + const { jitsiTrack } = action.track; + if (jitsiTrack.isMuted() + && jitsiTrack.type === MEDIA_TYPE.VIDEO && jitsiTrack.videoType === VIDEO_TYPE.DESKTOP) { + store.dispatch(toggleScreensharing(false)); + } + break; + } } return next(action);