ref(participants) Remove sortedRemoteScreenshares used by legacy SS.

pull/12734/head jitsi-meet_8186
Jaya Allamsetty 2 years ago
parent 3b8ad78a62
commit 561d0c9a10
  1. 2
      react/features/base/lastn/middleware.ts
  2. 28
      react/features/base/participants/reducer.ts
  3. 12
      react/features/video-layout/actionTypes.ts
  4. 19
      react/features/video-layout/actions.any.ts
  5. 29
      react/features/video-layout/middleware.any.ts
  6. 2
      react/features/video-layout/reducer.ts

@ -5,7 +5,6 @@ import { SET_FILMSTRIP_ENABLED } from '../../filmstrip/actionTypes';
import { SELECT_LARGE_VIDEO_PARTICIPANT } from '../../large-video/actionTypes';
import { APP_STATE_CHANGED } from '../../mobile/background/actionTypes';
import {
SCREEN_SHARE_REMOTE_PARTICIPANTS_UPDATED,
SET_CAR_MODE,
SET_TILE_VIEW,
VIRTUAL_SCREENSHARE_REMOTE_PARTICIPANTS_UPDATED
@ -102,7 +101,6 @@ MiddlewareRegistry.register(store => next => action => {
case PARTICIPANT_JOINED:
case PARTICIPANT_KICKED:
case PARTICIPANT_LEFT:
case SCREEN_SHARE_REMOTE_PARTICIPANTS_UPDATED:
case SELECT_LARGE_VIDEO_PARTICIPANT:
case SET_AUDIO_ONLY:
case SET_CAR_MODE:

@ -1,6 +1,3 @@
import {
SCREEN_SHARE_REMOTE_PARTICIPANTS_UPDATED
} from '../../video-layout/actionTypes';
import ReducerRegistry from '../redux/ReducerRegistry';
import { set } from '../redux/functions';
@ -74,7 +71,6 @@ const DEFAULT_STATE = {
remote: new Map(),
sortedRemoteVirtualScreenshareParticipants: new Map(),
sortedRemoteParticipants: new Map(),
sortedRemoteScreenshares: new Map(),
speakersList: new Map()
};
@ -89,7 +85,6 @@ export interface IParticipantsState {
raisedHandsQueue: Array<{ id: string; raisedHandTimestamp: number; }>;
remote: Map<string, IParticipant>;
sortedRemoteParticipants: Map<string, string>;
sortedRemoteScreenshares: Map<string, string>;
sortedRemoteVirtualScreenshareParticipants: Map<string, string>;
speakersList: Map<string, string>;
}
@ -385,29 +380,6 @@ ReducerRegistry.register<IParticipantsState>('features/base/participants',
raisedHandsQueue: action.queue
};
}
case SCREEN_SHARE_REMOTE_PARTICIPANTS_UPDATED: {
const { participantIds } = action;
const sortedSharesList = [];
for (const participant of participantIds) {
const remoteParticipant = state.remote.get(participant);
if (remoteParticipant) {
const displayName
= _getDisplayName(state, remoteParticipant.name);
sortedSharesList.push([ participant, displayName ]);
}
}
// Keep the remote screen share list sorted alphabetically.
sortedSharesList.length && sortedSharesList.sort((a, b) => a[1].localeCompare(b[1]));
// @ts-ignore
state.sortedRemoteScreenshares = new Map(sortedSharesList);
return { ...state };
}
case OVERWRITE_PARTICIPANT_NAME: {
const { id, name } = action;

@ -1,15 +1,3 @@
/**
* The type of the action which sets the list of known remote participant IDs which
* have an active screen share.
*
* @returns {{
* type: SCREEN_SHARE_REMOTE_PARTICIPANTS_UPDATED,
* participantIds: Array<string>
* }}
*/
export const SCREEN_SHARE_REMOTE_PARTICIPANTS_UPDATED
= 'SCREEN_SHARE_REMOTE_PARTICIPANTS_UPDATED';
/**
* The type of the action which tells whether we are in carmode.
*

@ -1,30 +1,11 @@
import { IStore } from '../app/types';
import {
SCREEN_SHARE_REMOTE_PARTICIPANTS_UPDATED,
SET_TILE_VIEW,
VIRTUAL_SCREENSHARE_REMOTE_PARTICIPANTS_UPDATED
} from './actionTypes';
import { shouldDisplayTileView } from './functions';
/**
* Creates a (redux) action which signals that the list of known remote participants
* with screen shares has changed.
*
* @param {string} participantIds - The remote participants which currently have active
* screen share streams.
* @returns {{
* type: SCREEN_SHARE_REMOTE_PARTICIPANTS_UPDATED,
* participantId: string
* }}
*/
export function setRemoteParticipantsWithScreenShare(participantIds: Array<string>) {
return {
type: SCREEN_SHARE_REMOTE_PARTICIPANTS_UPDATED,
participantIds
};
}
/**
* Creates a (redux) action which signals that the list of known remote virtual screen share participant ids has
* changed.

@ -1,18 +1,16 @@
import { IStore } from '../app/types';
import { getCurrentConference } from '../base/conference/functions';
import { VIDEO_TYPE } from '../base/media/constants';
import { PARTICIPANT_LEFT, PIN_PARTICIPANT } from '../base/participants/actionTypes';
import { pinParticipant } from '../base/participants/actions';
import { getParticipantById, getPinnedParticipant } from '../base/participants/functions';
import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
import StateListenerRegistry from '../base/redux/StateListenerRegistry';
import { TRACK_REMOVED } from '../base/tracks/actionTypes';
import { SET_DOCUMENT_EDITING_STATUS } from '../etherpad/actionTypes';
import { isStageFilmstripEnabled } from '../filmstrip/functions';
import { isFollowMeActive } from '../follow-me/functions';
import { SET_TILE_VIEW } from './actionTypes';
import { setRemoteParticipantsWithScreenShare, setTileView } from './actions';
import { setTileView } from './actions';
import { getAutoPinSetting, updateAutoPinnedParticipant } from './functions';
import './subscriber';
@ -74,31 +72,6 @@ MiddlewareRegistry.register(store => next => action => {
}
break;
}
// Update the remoteScreenShares.
// Because of the debounce in the subscriber which updates the remoteScreenShares we need to handle
// removal of screen shares separately 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?.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) {

@ -1,7 +1,6 @@
import ReducerRegistry from '../base/redux/ReducerRegistry';
import {
SCREEN_SHARE_REMOTE_PARTICIPANTS_UPDATED,
SET_CAR_MODE,
SET_TILE_VIEW,
VIRTUAL_SCREENSHARE_REMOTE_PARTICIPANTS_UPDATED
@ -41,7 +40,6 @@ const STORE_NAME = 'features/video-layout';
ReducerRegistry.register<IVideoLayoutState>(STORE_NAME, (state = DEFAULT_STATE, action): IVideoLayoutState => {
switch (action.type) {
case SCREEN_SHARE_REMOTE_PARTICIPANTS_UPDATED:
case VIRTUAL_SCREENSHARE_REMOTE_PARTICIPANTS_UPDATED:
return {
...state,

Loading…
Cancel
Save