You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

reducer.ts 1022B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import ReducerRegistry from '../base/redux/ReducerRegistry';
  2. import {
  3. SET_SCREENSHARE_CAPTURE_FRAME_RATE,
  4. SET_SCREENSHARE_TRACKS,
  5. SET_SCREEN_AUDIO_SHARE_STATE
  6. } from './actionTypes';
  7. export interface IScreenShareState {
  8. captureFrameRate?: number;
  9. desktopAudioTrack?: any;
  10. isSharingAudio?: boolean;
  11. }
  12. /**
  13. * Reduces the Redux actions of the feature features/screen-share.
  14. */
  15. ReducerRegistry.register<IScreenShareState>('features/screen-share', (state = {}, action): IScreenShareState => {
  16. const { captureFrameRate, isSharingAudio, desktopAudioTrack } = action;
  17. switch (action.type) {
  18. case SET_SCREEN_AUDIO_SHARE_STATE:
  19. return {
  20. ...state,
  21. isSharingAudio
  22. };
  23. case SET_SCREENSHARE_CAPTURE_FRAME_RATE:
  24. return {
  25. ...state,
  26. captureFrameRate
  27. };
  28. case SET_SCREENSHARE_TRACKS:
  29. return {
  30. ...state,
  31. desktopAudioTrack
  32. };
  33. default:
  34. return state;
  35. }
  36. });