Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

reducer.ts 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import ReducerRegistry from '../base/redux/ReducerRegistry';
  2. import {
  3. SCREEN_SHARE_REMOTE_PARTICIPANTS_UPDATED,
  4. SET_CAR_MODE,
  5. SET_TILE_VIEW,
  6. VIRTUAL_SCREENSHARE_REMOTE_PARTICIPANTS_UPDATED
  7. } from './actionTypes';
  8. const DEFAULT_STATE = {
  9. /**
  10. * Whether we are in carmode.
  11. *
  12. * @public
  13. * @type {boolean}
  14. */
  15. carMode: false,
  16. remoteScreenShares: [],
  17. /**
  18. * The indicator which determines whether the video layout should display
  19. * video thumbnails in a tiled layout.
  20. *
  21. * Note: undefined means that the user hasn't requested anything in particular yet, so
  22. * we use our auto switching rules.
  23. *
  24. * @public
  25. * @type {boolean}
  26. */
  27. tileViewEnabled: undefined
  28. };
  29. export interface IVideoLayoutState {
  30. carMode: boolean;
  31. remoteScreenShares: string[];
  32. tileViewEnabled?: boolean;
  33. }
  34. const STORE_NAME = 'features/video-layout';
  35. ReducerRegistry.register<IVideoLayoutState>(STORE_NAME, (state = DEFAULT_STATE, action): IVideoLayoutState => {
  36. switch (action.type) {
  37. case SCREEN_SHARE_REMOTE_PARTICIPANTS_UPDATED:
  38. case VIRTUAL_SCREENSHARE_REMOTE_PARTICIPANTS_UPDATED:
  39. return {
  40. ...state,
  41. remoteScreenShares: action.participantIds
  42. };
  43. case SET_CAR_MODE:
  44. return {
  45. ...state,
  46. carMode: action.enabled
  47. };
  48. case SET_TILE_VIEW:
  49. return {
  50. ...state,
  51. tileViewEnabled: action.enabled
  52. };
  53. }
  54. return state;
  55. });