fix(screenshare-filmstrip) Fix pin screenshare (#11892)
On click on a screenshare pin that to stage (allows users to choose between multiple screenshares)
This commit is contained in:
parent
dbc29a08ee
commit
5783e8992a
|
@ -206,6 +206,16 @@ export const TOGGLE_PIN_STAGE_PARTICIPANT = 'TOGGLE_PIN_STAGE_PARTICIPANT';
|
||||||
*/
|
*/
|
||||||
export const CLEAR_STAGE_PARTICIPANTS = 'CLEAR_STAGE_PARTICIPANTS';
|
export const CLEAR_STAGE_PARTICIPANTS = 'CLEAR_STAGE_PARTICIPANTS';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The type of Redux action which sets the participant to be displayed
|
||||||
|
* on the screenshare filmstrip.
|
||||||
|
* {
|
||||||
|
* type: SET_SCREENSHARE_FILMSTRIP_PARTICIPANT,
|
||||||
|
* participantId: string|undefined
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
export const SET_SCREENSHARE_FILMSTRIP_PARTICIPANT = 'SET_SCREENSHARE_FILMSTRIP_PARTICIPANT';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The type of Redux action which sets the dimensions of the screenshare tile.
|
* The type of Redux action which sets the dimensions of the screenshare tile.
|
||||||
* {
|
* {
|
||||||
|
|
|
@ -29,7 +29,8 @@ import {
|
||||||
SET_SCREENSHARING_TILE_DIMENSIONS,
|
SET_SCREENSHARING_TILE_DIMENSIONS,
|
||||||
SET_USER_FILMSTRIP_HEIGHT,
|
SET_USER_FILMSTRIP_HEIGHT,
|
||||||
SET_FILMSTRIP_HEIGHT,
|
SET_FILMSTRIP_HEIGHT,
|
||||||
SET_TOP_PANEL_VISIBILITY
|
SET_TOP_PANEL_VISIBILITY,
|
||||||
|
SET_SCREENSHARE_FILMSTRIP_PARTICIPANT
|
||||||
} from './actionTypes';
|
} from './actionTypes';
|
||||||
import {
|
import {
|
||||||
HORIZONTAL_FILMSTRIP_MARGIN,
|
HORIZONTAL_FILMSTRIP_MARGIN,
|
||||||
|
@ -573,3 +574,16 @@ export function setTopPanelVisible(visible) {
|
||||||
visible
|
visible
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the participant whose screenshare to be displayed on the filmstrip.
|
||||||
|
*
|
||||||
|
* @param {string|undefined} participantId - The id of the participant to be set.
|
||||||
|
* @returns {Object}
|
||||||
|
*/
|
||||||
|
export function setScreenshareFilmstripParticipant(participantId) {
|
||||||
|
return {
|
||||||
|
type: SET_SCREENSHARE_FILMSTRIP_PARTICIPANT,
|
||||||
|
participantId
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
|
@ -101,18 +101,26 @@ const ScreenshareFilmstrip = (props: Props) => props._currentLayout === LAYOUTS.
|
||||||
*/
|
*/
|
||||||
function _mapStateToProps(state) {
|
function _mapStateToProps(state) {
|
||||||
const {
|
const {
|
||||||
filmstripHeight,
|
screenshareFilmstripDimensions: {
|
||||||
filmstripWidth,
|
filmstripHeight,
|
||||||
thumbnailSize
|
filmstripWidth,
|
||||||
} = state['features/filmstrip'].screenshareFilmstripDimensions;
|
thumbnailSize
|
||||||
|
},
|
||||||
|
screenshareFilmstripParticipantId
|
||||||
|
} = state['features/filmstrip'];
|
||||||
const screenshares = state['features/video-layout'].remoteScreenShares;
|
const screenshares = state['features/video-layout'].remoteScreenShares;
|
||||||
|
let id = screenshares.find(sId => sId === screenshareFilmstripParticipantId);
|
||||||
|
|
||||||
|
if (!id && screenshares.length) {
|
||||||
|
id = screenshares[0];
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
_columns: 1,
|
_columns: 1,
|
||||||
_currentLayout: getCurrentLayout(state),
|
_currentLayout: getCurrentLayout(state),
|
||||||
_filmstripHeight: filmstripHeight,
|
_filmstripHeight: filmstripHeight,
|
||||||
_filmstripWidth: filmstripWidth,
|
_filmstripWidth: filmstripWidth,
|
||||||
_remoteParticipants: screenshares.length ? [ screenshares[0] ] : [],
|
_remoteParticipants: id ? [ id ] : [],
|
||||||
_resizableFilmstrip: false,
|
_resizableFilmstrip: false,
|
||||||
_rows: 1,
|
_rows: 1,
|
||||||
_thumbnailWidth: thumbnailSize?.width,
|
_thumbnailWidth: thumbnailSize?.width,
|
||||||
|
|
|
@ -288,11 +288,17 @@ function _mapStateToProps(state, ownProps) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_currentLayout === LAYOUTS.STAGE_FILMSTRIP_VIEW && filmstripType === FILMSTRIP_TYPE.SCREENSHARE) {
|
if (_currentLayout === LAYOUTS.STAGE_FILMSTRIP_VIEW && filmstripType === FILMSTRIP_TYPE.SCREENSHARE) {
|
||||||
const { remoteScreenShares } = state['features/video-layout'];
|
const { screenshareFilmstripParticipantId } = state['features/filmstrip'];
|
||||||
|
const screenshares = state['features/video-layout'].remoteScreenShares;
|
||||||
|
let id = screenshares.find(sId => sId === screenshareFilmstripParticipantId);
|
||||||
|
|
||||||
|
if (!id && screenshares.length) {
|
||||||
|
id = screenshares[screenshares.length - 1];
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
_filmstripType: filmstripType,
|
_filmstripType: filmstripType,
|
||||||
_participantID: remoteScreenShares[remoteScreenShares.length - 1]
|
_participantID: id
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,8 +33,9 @@ import {
|
||||||
removeStageParticipant,
|
removeStageParticipant,
|
||||||
setFilmstripHeight,
|
setFilmstripHeight,
|
||||||
setFilmstripWidth,
|
setFilmstripWidth,
|
||||||
|
setScreenshareFilmstripParticipant,
|
||||||
setStageParticipants
|
setStageParticipants
|
||||||
} from './actions';
|
} from './actions.web';
|
||||||
import {
|
import {
|
||||||
ACTIVE_PARTICIPANT_TIMEOUT,
|
ACTIVE_PARTICIPANT_TIMEOUT,
|
||||||
DEFAULT_FILMSTRIP_WIDTH,
|
DEFAULT_FILMSTRIP_WIDTH,
|
||||||
|
@ -45,12 +46,13 @@ import {
|
||||||
} from './constants';
|
} from './constants';
|
||||||
import {
|
import {
|
||||||
isFilmstripResizable,
|
isFilmstripResizable,
|
||||||
|
isTopPanelEnabled,
|
||||||
|
isStageFilmstripAvailable,
|
||||||
updateRemoteParticipants,
|
updateRemoteParticipants,
|
||||||
updateRemoteParticipantsOnLeave,
|
updateRemoteParticipantsOnLeave,
|
||||||
getActiveParticipantsIds,
|
getActiveParticipantsIds,
|
||||||
getPinnedActiveParticipants,
|
getPinnedActiveParticipants
|
||||||
isStageFilmstripAvailable
|
} from './functions.web';
|
||||||
} from './functions';
|
|
||||||
import './subscriber';
|
import './subscriber';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -276,6 +278,15 @@ MiddlewareRegistry.register(store => next => action => {
|
||||||
const pinnedParticipants = getPinnedActiveParticipants(state);
|
const pinnedParticipants = getPinnedActiveParticipants(state);
|
||||||
const dominant = getDominantSpeakerParticipant(state);
|
const dominant = getDominantSpeakerParticipant(state);
|
||||||
|
|
||||||
|
if (isTopPanelEnabled(state)) {
|
||||||
|
const screenshares = state['features/video-layout'].remoteScreenShares;
|
||||||
|
|
||||||
|
if (screenshares.find(sId => sId === participantId)) {
|
||||||
|
dispatch(setScreenshareFilmstripParticipant(participantId));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (pinnedParticipants.find(p => p.participantId === participantId)) {
|
if (pinnedParticipants.find(p => p.participantId === participantId)) {
|
||||||
if (dominant?.id === participantId) {
|
if (dominant?.id === participantId) {
|
||||||
const { activeParticipants } = state['features/filmstrip'];
|
const { activeParticipants } = state['features/filmstrip'];
|
||||||
|
|
|
@ -23,7 +23,8 @@ import {
|
||||||
SET_SCREENSHARING_TILE_DIMENSIONS,
|
SET_SCREENSHARING_TILE_DIMENSIONS,
|
||||||
SET_USER_FILMSTRIP_HEIGHT,
|
SET_USER_FILMSTRIP_HEIGHT,
|
||||||
SET_FILMSTRIP_HEIGHT,
|
SET_FILMSTRIP_HEIGHT,
|
||||||
SET_TOP_PANEL_VISIBILITY
|
SET_TOP_PANEL_VISIBILITY,
|
||||||
|
SET_SCREENSHARE_FILMSTRIP_PARTICIPANT
|
||||||
} from './actionTypes';
|
} from './actionTypes';
|
||||||
|
|
||||||
const DEFAULT_STATE = {
|
const DEFAULT_STATE = {
|
||||||
|
@ -85,6 +86,12 @@ const DEFAULT_STATE = {
|
||||||
*/
|
*/
|
||||||
screenshareFilmstripDimensions: {},
|
screenshareFilmstripDimensions: {},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The id of the participant whose screenshare to
|
||||||
|
* display on the screenshare filmstrip.
|
||||||
|
*/
|
||||||
|
screenshareFilmstripParticipantId: null,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The stage filmstrip view dimensions.
|
* The stage filmstrip view dimensions.
|
||||||
*
|
*
|
||||||
|
@ -345,6 +352,12 @@ ReducerRegistry.register(
|
||||||
topPanelVisible: action.visible
|
topPanelVisible: action.visible
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
case SET_SCREENSHARE_FILMSTRIP_PARTICIPANT: {
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
screenshareFilmstripParticipantId: action.participantId
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return state;
|
return state;
|
||||||
|
|
|
@ -16,9 +16,10 @@ import {
|
||||||
setHorizontalViewDimensions,
|
setHorizontalViewDimensions,
|
||||||
setScreensharingTileDimensions,
|
setScreensharingTileDimensions,
|
||||||
setStageFilmstripViewDimensions,
|
setStageFilmstripViewDimensions,
|
||||||
|
setScreenshareFilmstripParticipant,
|
||||||
setTileViewDimensions,
|
setTileViewDimensions,
|
||||||
setVerticalViewDimensions
|
setVerticalViewDimensions
|
||||||
} from './actions';
|
} from './actions.web';
|
||||||
import {
|
import {
|
||||||
ASPECT_RATIO_BREAKPOINT,
|
ASPECT_RATIO_BREAKPOINT,
|
||||||
DISPLAY_DRAWER_THRESHOLD
|
DISPLAY_DRAWER_THRESHOLD
|
||||||
|
@ -26,7 +27,7 @@ import {
|
||||||
import {
|
import {
|
||||||
isFilmstripResizable,
|
isFilmstripResizable,
|
||||||
isTopPanelEnabled
|
isTopPanelEnabled
|
||||||
} from './functions';
|
} from './functions.web';
|
||||||
|
|
||||||
import './subscriber.any';
|
import './subscriber.any';
|
||||||
|
|
||||||
|
@ -227,3 +228,16 @@ StateListenerRegistry.register(
|
||||||
deepEquals: true
|
deepEquals: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Listens for changes to clear invalid data.
|
||||||
|
*/
|
||||||
|
StateListenerRegistry.register(
|
||||||
|
/* selector */ state => state['features/video-layout'].remoteScreenShares.length,
|
||||||
|
/* listener */(length, store) => {
|
||||||
|
if (length === 0) {
|
||||||
|
store.dispatch(setScreenshareFilmstripParticipant());
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
deepEquals: true
|
||||||
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue