2017-10-09 10:03:02 -05:00
|
|
|
// @flow
|
|
|
|
|
|
2016-10-05 09:36:59 -05:00
|
|
|
import { PARTICIPANT_ID_CHANGED } from '../base/participants';
|
|
|
|
|
import { ReducerRegistry } from '../base/redux';
|
|
|
|
|
|
2017-08-09 12:40:03 -07:00
|
|
|
import {
|
|
|
|
|
SELECT_LARGE_VIDEO_PARTICIPANT,
|
2022-08-05 12:11:09 +03:00
|
|
|
UPDATE_KNOWN_LARGE_VIDEO_RESOLUTION,
|
|
|
|
|
UPDATE_LAST_LARGE_VIDEO_MEDIA_EVENT,
|
|
|
|
|
SET_SEE_WHAT_IS_BEING_SHARED
|
2017-08-09 12:40:03 -07:00
|
|
|
} from './actionTypes';
|
2016-10-05 09:36:59 -05:00
|
|
|
|
2017-01-17 08:44:50 -06:00
|
|
|
ReducerRegistry.register('features/large-video', (state = {}, action) => {
|
2016-12-13 03:15:05 -06:00
|
|
|
switch (action.type) {
|
2016-10-05 09:36:59 -05:00
|
|
|
|
2016-12-13 03:15:05 -06:00
|
|
|
// When conference is joined, we update ID of local participant from default
|
|
|
|
|
// 'local' to real ID. However, in large video we might have already
|
|
|
|
|
// selected 'local' as participant on stage. So in this case we must update
|
|
|
|
|
// ID of participant on stage to match ID in 'participants' state to avoid
|
|
|
|
|
// additional changes in state and (re)renders.
|
|
|
|
|
case PARTICIPANT_ID_CHANGED:
|
|
|
|
|
if (state.participantId === action.oldValue) {
|
2016-10-05 09:36:59 -05:00
|
|
|
return {
|
|
|
|
|
...state,
|
2016-12-13 03:15:05 -06:00
|
|
|
participantId: action.newValue
|
2016-10-05 09:36:59 -05:00
|
|
|
};
|
|
|
|
|
}
|
2016-12-13 03:15:05 -06:00
|
|
|
break;
|
|
|
|
|
|
2017-01-11 12:14:00 -06:00
|
|
|
case SELECT_LARGE_VIDEO_PARTICIPANT:
|
2016-12-13 03:15:05 -06:00
|
|
|
return {
|
|
|
|
|
...state,
|
|
|
|
|
participantId: action.participantId
|
|
|
|
|
};
|
2017-08-09 12:40:03 -07:00
|
|
|
|
|
|
|
|
case UPDATE_KNOWN_LARGE_VIDEO_RESOLUTION:
|
|
|
|
|
return {
|
|
|
|
|
...state,
|
|
|
|
|
resolution: action.resolution
|
|
|
|
|
};
|
2020-12-08 08:01:16 -06:00
|
|
|
|
|
|
|
|
case UPDATE_LAST_LARGE_VIDEO_MEDIA_EVENT:
|
|
|
|
|
return {
|
|
|
|
|
...state,
|
|
|
|
|
lastMediaEvent: action.name
|
|
|
|
|
};
|
|
|
|
|
|
2022-08-05 12:11:09 +03:00
|
|
|
case SET_SEE_WHAT_IS_BEING_SHARED:
|
|
|
|
|
return {
|
|
|
|
|
...state,
|
|
|
|
|
seeWhatIsBeingShared: action.seeWhatIsBeingShared
|
|
|
|
|
};
|
|
|
|
|
|
2016-12-13 03:15:05 -06:00
|
|
|
}
|
2016-11-04 13:28:47 -05:00
|
|
|
|
2016-12-13 03:15:05 -06:00
|
|
|
return state;
|
|
|
|
|
});
|