chore(mobile) changes the name for screenShares to remoteScreenShares to better reflect it's content

This commit is contained in:
Titus-Andrei Moldovan 2021-01-28 14:36:01 +02:00 committed by tmoldovan8x8
parent 45f4643469
commit af8072d9d2
7 changed files with 29 additions and 29 deletions

View File

@ -3,7 +3,7 @@
import { SET_FILMSTRIP_ENABLED } from '../../filmstrip/actionTypes'; import { SET_FILMSTRIP_ENABLED } from '../../filmstrip/actionTypes';
import { SELECT_LARGE_VIDEO_PARTICIPANT } from '../../large-video/actionTypes'; import { SELECT_LARGE_VIDEO_PARTICIPANT } from '../../large-video/actionTypes';
import { APP_STATE_CHANGED } from '../../mobile/background/actionTypes'; import { APP_STATE_CHANGED } from '../../mobile/background/actionTypes';
import { SCREEN_SHARE_PARTICIPANTS_UPDATED, SET_TILE_VIEW } from '../../video-layout/actionTypes'; import { SCREEN_SHARE_REMOTE_PARTICIPANTS_UPDATED, SET_TILE_VIEW } from '../../video-layout/actionTypes';
import { SET_AUDIO_ONLY } from '../audio-only/actionTypes'; import { SET_AUDIO_ONLY } from '../audio-only/actionTypes';
import { CONFERENCE_JOINED } from '../conference/actionTypes'; import { CONFERENCE_JOINED } from '../conference/actionTypes';
import { import {
@ -33,7 +33,7 @@ MiddlewareRegistry.register(store => next => action => {
case PARTICIPANT_JOINED: case PARTICIPANT_JOINED:
case PARTICIPANT_KICKED: case PARTICIPANT_KICKED:
case PARTICIPANT_LEFT: case PARTICIPANT_LEFT:
case SCREEN_SHARE_PARTICIPANTS_UPDATED: case SCREEN_SHARE_REMOTE_PARTICIPANTS_UPDATED:
case SELECT_LARGE_VIDEO_PARTICIPANT: case SELECT_LARGE_VIDEO_PARTICIPANT:
case SET_AUDIO_ONLY: case SET_AUDIO_ONLY:
case SET_FILMSTRIP_ENABLED: case SET_FILMSTRIP_ENABLED:
@ -80,7 +80,7 @@ function _updateLastN({ getState }) {
if (typeof appState !== 'undefined' && appState !== 'active') { if (typeof appState !== 'undefined' && appState !== 'active') {
lastN = isLocalVideoTrackDesktop(state) ? 1 : 0; lastN = isLocalVideoTrackDesktop(state) ? 1 : 0;
} else if (audioOnly) { } else if (audioOnly) {
const { screenShares, tileViewEnabled } = state['features/video-layout']; const { remoteScreenShares, tileViewEnabled } = state['features/video-layout'];
const largeVideoParticipantId = state['features/large-video'].participantId; const largeVideoParticipantId = state['features/large-video'].participantId;
const largeVideoParticipant const largeVideoParticipant
= largeVideoParticipantId ? getParticipantById(state, largeVideoParticipantId) : undefined; = largeVideoParticipantId ? getParticipantById(state, largeVideoParticipantId) : undefined;
@ -89,7 +89,7 @@ function _updateLastN({ getState }) {
// view since we make an exception only for screenshare when in audio-only mode. If the user unpins // view since we make an exception only for screenshare when in audio-only mode. If the user unpins
// the screenshare, lastN will be set to 0 here. It will be set to 1 if screenshare has been auto pinned. // the screenshare, lastN will be set to 0 here. It will be set to 1 if screenshare has been auto pinned.
if (!tileViewEnabled && largeVideoParticipant && !largeVideoParticipant.local) { if (!tileViewEnabled && largeVideoParticipant && !largeVideoParticipant.local) {
lastN = (screenShares || []).includes(largeVideoParticipantId) ? 1 : 0; lastN = (remoteScreenShares || []).includes(largeVideoParticipantId) ? 1 : 0;
} else { } else {
lastN = 0; lastN = 0;
} }

View File

@ -360,10 +360,10 @@ export function shouldRenderParticipantVideo(stateful: Object | Function, id: st
} }
/* Last, check if the participant is sharing their screen and they are on stage. */ /* Last, check if the participant is sharing their screen and they are on stage. */
const screenShares = state['features/video-layout'].screenShares || []; const remoteScreenShares = state['features/video-layout'].remoteScreenShares || [];
const largeVideoParticipantId = state['features/large-video'].participantId; const largeVideoParticipantId = state['features/large-video'].participantId;
const participantIsInLargeVideoWithScreen const participantIsInLargeVideoWithScreen
= participant.id === largeVideoParticipantId && screenShares.includes(participant.id); = participant.id === largeVideoParticipantId && remoteScreenShares.includes(participant.id);
return participantIsInLargeVideoWithScreen; return participantIsInLargeVideoWithScreen;
} }

View File

@ -61,11 +61,11 @@ export function selectParticipantInLargeVideo(participant: ?string) {
const state = getState(); const state = getState();
const participantId = participant ?? _electParticipantInLargeVideo(state); const participantId = participant ?? _electParticipantInLargeVideo(state);
const largeVideo = state['features/large-video']; const largeVideo = state['features/large-video'];
const screenShares = state['features/video-layout'].screenShares; const remoteScreenShares = state['features/video-layout'].remoteScreenShares;
let latestScreenshareParticipantId; let latestScreenshareParticipantId;
if (screenShares && screenShares.length) { if (remoteScreenShares && remoteScreenShares.length) {
latestScreenshareParticipantId = screenShares[screenShares.length - 1]; latestScreenshareParticipantId = remoteScreenShares[remoteScreenShares.length - 1];
} }
// When trying to auto pin screenshare, always select the endpoint even though it happens to be // When trying to auto pin screenshare, always select the endpoint even though it happens to be

View File

@ -1,14 +1,14 @@
/** /**
* The type of the action which sets the list of known participant IDs which * The type of the action which sets the list of known remote participant IDs which
* have an active screen share. * have an active screen share.
* *
* @returns {{ * @returns {{
* type: SCREEN_SHARE_PARTICIPANTS_UPDATED, * type: SCREEN_SHARE_REMOTE_PARTICIPANTS_UPDATED,
* participantIds: Array<string> * participantIds: Array<string>
* }} * }}
*/ */
export const SCREEN_SHARE_PARTICIPANTS_UPDATED export const SCREEN_SHARE_REMOTE_PARTICIPANTS_UPDATED
= 'SCREEN_SHARE_PARTICIPANTS_UPDATED'; = 'SCREEN_SHARE_REMOTE_PARTICIPANTS_UPDATED';
/** /**
* The type of the action which enables or disables the feature for showing * The type of the action which enables or disables the feature for showing

View File

@ -3,25 +3,25 @@
import type { Dispatch } from 'redux'; import type { Dispatch } from 'redux';
import { import {
SCREEN_SHARE_PARTICIPANTS_UPDATED, SCREEN_SHARE_REMOTE_PARTICIPANTS_UPDATED,
SET_TILE_VIEW SET_TILE_VIEW
} from './actionTypes'; } from './actionTypes';
import { shouldDisplayTileView } from './functions'; import { shouldDisplayTileView } from './functions';
/** /**
* Creates a (redux) action which signals that the list of known participants * Creates a (redux) action which signals that the list of known remote participants
* with screen shares has changed. * with screen shares has changed.
* *
* @param {string} participantIds - The participants which currently have active * @param {string} participantIds - The remote participants which currently have active
* screen share streams. * screen share streams.
* @returns {{ * @returns {{
* type: SCREEN_SHARE_PARTICIPANTS_UPDATED, * type: SCREEN_SHARE_REMOTE_PARTICIPANTS_UPDATED,
* participantId: string * participantId: string
* }} * }}
*/ */
export function setParticipantsWithScreenShare(participantIds: Array<string>) { export function setRemoteParticipantsWithScreenShare(participantIds: Array<string>) {
return { return {
type: SCREEN_SHARE_PARTICIPANTS_UPDATED, type: SCREEN_SHARE_REMOTE_PARTICIPANTS_UPDATED,
participantIds participantIds
}; };
} }

View File

@ -3,12 +3,12 @@
import { ReducerRegistry } from '../base/redux'; import { ReducerRegistry } from '../base/redux';
import { import {
SCREEN_SHARE_PARTICIPANTS_UPDATED, SCREEN_SHARE_REMOTE_PARTICIPANTS_UPDATED,
SET_TILE_VIEW SET_TILE_VIEW
} from './actionTypes'; } from './actionTypes';
const DEFAULT_STATE = { const DEFAULT_STATE = {
screenShares: [], remoteScreenShares: [],
/** /**
* The indicator which determines whether the video layout should display * The indicator which determines whether the video layout should display
@ -27,10 +27,10 @@ const STORE_NAME = 'features/video-layout';
ReducerRegistry.register(STORE_NAME, (state = DEFAULT_STATE, action) => { ReducerRegistry.register(STORE_NAME, (state = DEFAULT_STATE, action) => {
switch (action.type) { switch (action.type) {
case SCREEN_SHARE_PARTICIPANTS_UPDATED: { case SCREEN_SHARE_REMOTE_PARTICIPANTS_UPDATED: {
return { return {
...state, ...state,
screenShares: action.participantIds remoteScreenShares: action.participantIds
}; };
} }

View File

@ -7,7 +7,7 @@ import { StateListenerRegistry, equals } from '../base/redux';
import { isFollowMeActive } from '../follow-me'; import { isFollowMeActive } from '../follow-me';
import { selectParticipant } from '../large-video/actions'; import { selectParticipant } from '../large-video/actions';
import { setParticipantsWithScreenShare } from './actions'; import { setRemoteParticipantsWithScreenShare } from './actions';
declare var APP: Object; declare var APP: Object;
declare var interfaceConfig: Object; declare var interfaceConfig: Object;
@ -37,7 +37,7 @@ StateListenerRegistry.register(
return; return;
} }
const oldScreenSharesOrder = store.getState()['features/video-layout'].screenShares || []; const oldScreenSharesOrder = store.getState()['features/video-layout'].remoteScreenShares || [];
const knownSharingParticipantIds = tracks.reduce((acc, track) => { const knownSharingParticipantIds = tracks.reduce((acc, track) => {
if (track.mediaType === 'video' && track.videoType === 'desktop') { if (track.mediaType === 'video' && track.videoType === 'desktop') {
const skipTrack = _getAutoPinSetting() === 'remote-only' && track.local; const skipTrack = _getAutoPinSetting() === 'remote-only' && track.local;
@ -66,7 +66,7 @@ StateListenerRegistry.register(
if (!equals(oldScreenSharesOrder, newScreenSharesOrder)) { if (!equals(oldScreenSharesOrder, newScreenSharesOrder)) {
store.dispatch( store.dispatch(
setParticipantsWithScreenShare(newScreenSharesOrder)); setRemoteParticipantsWithScreenShare(newScreenSharesOrder));
_updateAutoPinnedParticipant(store); _updateAutoPinnedParticipant(store);
} }
@ -96,14 +96,14 @@ function _getAutoPinSetting() {
*/ */
function _updateAutoPinnedParticipant({ dispatch, getState }) { function _updateAutoPinnedParticipant({ dispatch, getState }) {
const state = getState(); const state = getState();
const screenShares = state['features/video-layout'].screenShares; const remoteScreenShares = state['features/video-layout'].remoteScreenShares;
if (!screenShares) { if (!remoteScreenShares) {
return; return;
} }
const latestScreenshareParticipantId const latestScreenshareParticipantId
= screenShares[screenShares.length - 1]; = remoteScreenShares[remoteScreenShares.length - 1];
const pinned = getPinnedParticipant(getState); const pinned = getPinnedParticipant(getState);