|
|
|
@ -1,6 +1,7 @@ |
|
|
|
|
// @flow
|
|
|
|
|
|
|
|
|
|
import { getCurrentConference } from '../base/conference'; |
|
|
|
|
import { VIDEO_TYPE } from '../base/media'; |
|
|
|
|
import { |
|
|
|
|
PARTICIPANT_LEFT, |
|
|
|
|
PIN_PARTICIPANT, |
|
|
|
@ -9,11 +10,12 @@ import { |
|
|
|
|
getPinnedParticipant |
|
|
|
|
} from '../base/participants'; |
|
|
|
|
import { MiddlewareRegistry, StateListenerRegistry } from '../base/redux'; |
|
|
|
|
import { TRACK_REMOVED } from '../base/tracks'; |
|
|
|
|
import { SET_DOCUMENT_EDITING_STATUS } from '../etherpad'; |
|
|
|
|
import { isFollowMeActive } from '../follow-me'; |
|
|
|
|
|
|
|
|
|
import { SET_TILE_VIEW } from './actionTypes'; |
|
|
|
|
import { setTileView } from './actions'; |
|
|
|
|
import { setRemoteParticipantsWithScreenShare, setTileView } from './actions'; |
|
|
|
|
import { getAutoPinSetting, updateAutoPinnedParticipant } from './functions'; |
|
|
|
|
|
|
|
|
|
import './subscriber'; |
|
|
|
@ -70,6 +72,32 @@ MiddlewareRegistry.register(store => next => action => { |
|
|
|
|
if (action.enabled && getPinnedParticipant(store)) { |
|
|
|
|
store.dispatch(pinParticipant(null)); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
// Update the remoteScreenShares.
|
|
|
|
|
// Because of the debounce in the subscriber which updates the remoteScreenShares we need to handle
|
|
|
|
|
// removal of screen shares separatelly here. Otherwise it is possible to have screen sharing
|
|
|
|
|
// participant that has already left in the remoteScreenShares array. This can lead to rendering
|
|
|
|
|
// a thumbnails for already left participants since the remoteScreenShares array is used for
|
|
|
|
|
// building the ordered list of remote participants.
|
|
|
|
|
case TRACK_REMOVED: { |
|
|
|
|
const { jitsiTrack } = action.track; |
|
|
|
|
|
|
|
|
|
if (jitsiTrack && jitsiTrack.isVideoTrack() && jitsiTrack.getVideoType() === VIDEO_TYPE.DESKTOP) { |
|
|
|
|
const participantId = jitsiTrack.getParticipantId(); |
|
|
|
|
const oldScreenShares = store.getState()['features/video-layout'].remoteScreenShares || []; |
|
|
|
|
const newScreenShares = oldScreenShares.filter(id => id !== participantId); |
|
|
|
|
|
|
|
|
|
if (oldScreenShares.length !== newScreenShares.length) { // the participant was removed
|
|
|
|
|
store.dispatch(setRemoteParticipantsWithScreenShare(newScreenShares)); |
|
|
|
|
|
|
|
|
|
updateAutoPinnedParticipant(oldScreenShares, store); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (shouldUpdateAutoPin) { |
|
|
|
|