From 5811e0476c55843ab6edb14cc89aef8f0df41996 Mon Sep 17 00:00:00 2001 From: Titus-Andrei Moldovan Date: Wed, 24 Jun 2020 10:18:53 +0300 Subject: [PATCH] rn: fixes the bug on shared video not stopping when the user leaves the conferences --- react/features/youtube-player/middleware.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/react/features/youtube-player/middleware.js b/react/features/youtube-player/middleware.js index d193a639a..50108bd96 100644 --- a/react/features/youtube-player/middleware.js +++ b/react/features/youtube-player/middleware.js @@ -28,6 +28,7 @@ MiddlewareRegistry.register(store => next => action => { const conference = getCurrentConference(state); const localParticipantId = getLocalParticipant(state)?.id; const { videoId, status, ownerId, time } = action; + const { ownerId: stateOwnerId, videoId: stateVideoId } = state['features/youtube-player']; switch (action.type) { case TOGGLE_SHARED_VIDEO: @@ -37,8 +38,9 @@ MiddlewareRegistry.register(store => next => action => { dispatch(setSharedVideoStatus('', 'stop', 0, '')); break; case PARTICIPANT_LEFT: - if (action.participant.id === action.ownerId) { + if (action.participant.id === stateOwnerId) { dispatch(setSharedVideoStatus('', 'stop', 0, '')); + dispatch(participantLeft(stateVideoId, conference)); } break; case SET_SHARED_VIDEO_STATUS: