您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

reducer.js 1.2KB

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