Files
jitsi-meet/react/features/large-video/reducer.js
Дамян Минков 97f47998ba feat: Exposes a method for checking is remote track received and played/testing. (#8186)
* feat: Exposes a method for checking is remote track received and played.

Used for some tests in torture.

* squash: Drop not matching string.

Duplicate translation key with not matching content.

* squash: Moves torture specific functions to features/base/testing.

Listens for media events from the video tag of the large video and stores them in redux.

* squash: Fix comments.

* feat: Listens for media events from the video tag of the remote videos and stores them in redux.

* squash: Fix undefined videoTrack if between switches.
2020-12-08 08:01:16 -06:00

50 lines
1.4 KiB
JavaScript

// @flow
import { PARTICIPANT_ID_CHANGED } from '../base/participants';
import { ReducerRegistry } from '../base/redux';
import {
SELECT_LARGE_VIDEO_PARTICIPANT,
UPDATE_KNOWN_LARGE_VIDEO_RESOLUTION, UPDATE_LAST_LARGE_VIDEO_MEDIA_EVENT
} from './actionTypes';
ReducerRegistry.register('features/large-video', (state = {}, action) => {
switch (action.type) {
// 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) {
return {
...state,
participantId: action.newValue
};
}
break;
case SELECT_LARGE_VIDEO_PARTICIPANT:
return {
...state,
participantId: action.participantId
};
case UPDATE_KNOWN_LARGE_VIDEO_RESOLUTION:
return {
...state,
resolution: action.resolution
};
case UPDATE_LAST_LARGE_VIDEO_MEDIA_EVENT:
return {
...state,
lastMediaEvent: action.name
};
}
return state;
});