remove fake ss participant creation on track update
This commit is contained in:
parent
f87a1a0e3a
commit
4f21cca7d7
|
@ -73,7 +73,8 @@ MiddlewareRegistry.register(store => next => action => {
|
||||||
store.dispatch(getAvailableDevices());
|
store.dispatch(getAvailableDevices());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getSourceNameSignalingFeatureFlag(store.getState()) && action.track.videoType === VIDEO_TYPE.DESKTOP) {
|
if (getSourceNameSignalingFeatureFlag(store.getState())
|
||||||
|
&& action?.track?.jitsiTrack.videoType === VIDEO_TYPE.DESKTOP) {
|
||||||
createFakeScreenShareParticipant(store, action);
|
createFakeScreenShareParticipant(store, action);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -219,12 +220,6 @@ MiddlewareRegistry.register(store => next => action => {
|
||||||
const result = next(action);
|
const result = next(action);
|
||||||
const state = store.getState();
|
const state = store.getState();
|
||||||
|
|
||||||
// TODO: This is only used for testing, remove this when we can start sending screen shares as a separate
|
|
||||||
// track.
|
|
||||||
if (getSourceNameSignalingFeatureFlag(state) && action.track.videoType === VIDEO_TYPE.DESKTOP) {
|
|
||||||
createFakeScreenShareParticipant(store, action);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isPrejoinPageVisible(state)) {
|
if (isPrejoinPageVisible(state)) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -337,17 +332,23 @@ function _handleNoDataFromSourceErrors(store, action) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function createFakeScreenShareParticipant(store, action) {
|
/**
|
||||||
const { track } = action;
|
* Creates a fake participant for screen share using the track's source name as the participant id.
|
||||||
const { dispatch } = store;
|
*
|
||||||
const { conference } = store.getState()['features/base/conference'];
|
* @param {Store} store - The redux store in which the specified action is dispatched.
|
||||||
|
* @param {Action} action - The redux action dispatched in the specified store.
|
||||||
|
* @private
|
||||||
|
* @returns {void}
|
||||||
|
*/
|
||||||
|
function createFakeScreenShareParticipant({ dispatch, getState }, { track }) {
|
||||||
|
const state = getState();
|
||||||
const particiipantId = track?.jitsiTrack?.getParticipantId?.();
|
const particiipantId = track?.jitsiTrack?.getParticipantId?.();
|
||||||
const particiipant = getParticipantById(store.getState(), particiipantId);
|
const particiipant = getParticipantById(state, particiipantId);
|
||||||
const name = particiipant?.name ? `${particiipant.name}'s screen` : 'Fellow Jitster\'s Screen';
|
const name = particiipant?.name ? `${particiipant.name}'s screen` : 'Fellow Jitster\'s Screen';
|
||||||
|
|
||||||
dispatch(participantJoined({
|
dispatch(participantJoined({
|
||||||
conference,
|
conference: state['features/base/conference'].conference,
|
||||||
id: track.jitsiTrack.getSourceName(),
|
id: track.jitsiTrack.getSourceName(), // endpointID-video-idx
|
||||||
isFakeScreenShareParticipant: true,
|
isFakeScreenShareParticipant: true,
|
||||||
isLocalScreenShare: track?.jitsiTrack.isLocal(),
|
isLocalScreenShare: track?.jitsiTrack.isLocal(),
|
||||||
name
|
name
|
||||||
|
|
Loading…
Reference in New Issue