Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

reducer.js 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import { PARTICIPANT_ID_CHANGED } from '../base/participants';
  2. import { ReducerRegistry } from '../base/redux';
  3. import { LARGE_VIDEO_PARTICIPANT_CHANGED } from './actionTypes';
  4. const INITIAL_STATE = {
  5. participantId: undefined
  6. };
  7. ReducerRegistry.register(
  8. 'features/largeVideo',
  9. (state = INITIAL_STATE, action) => {
  10. switch (action.type) {
  11. // When conference is joined, we update ID of local participant from
  12. // default 'local' to real ID. However, in large video we might have
  13. // already selected 'local' as participant on stage. So in this case we
  14. // must update ID of participant on stage to match ID in 'participants'
  15. // state to avoid additional changes in state and (re)renders.
  16. case PARTICIPANT_ID_CHANGED:
  17. if (state.participantId === action.oldValue) {
  18. return {
  19. ...state,
  20. participantId: action.newValue
  21. };
  22. }
  23. return state;
  24. case LARGE_VIDEO_PARTICIPANT_CHANGED:
  25. return {
  26. ...state,
  27. participantId: action.participantId
  28. };
  29. default:
  30. return state;
  31. }
  32. });