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

reducer.ts 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import ReducerRegistry from '../base/redux/ReducerRegistry';
  2. import { RESET_SHARED_VIDEO_STATUS, SET_DISABLE_BUTTON, SET_SHARED_VIDEO_STATUS } from './actionTypes';
  3. const initialState = {};
  4. export interface ISharedVideoState {
  5. disabled?: boolean;
  6. muted?: boolean;
  7. ownerId?: string;
  8. status?: string;
  9. time?: number;
  10. videoUrl?: string;
  11. volume?: number;
  12. }
  13. /**
  14. * Reduces the Redux actions of the feature features/shared-video.
  15. */
  16. ReducerRegistry.register<ISharedVideoState>('features/shared-video',
  17. (state = initialState, action): ISharedVideoState => {
  18. const { videoUrl, status, time, ownerId, disabled, muted, volume } = action;
  19. switch (action.type) {
  20. case RESET_SHARED_VIDEO_STATUS:
  21. return initialState;
  22. case SET_SHARED_VIDEO_STATUS:
  23. return {
  24. ...state,
  25. muted,
  26. ownerId,
  27. status,
  28. time,
  29. videoUrl,
  30. volume
  31. };
  32. case SET_DISABLE_BUTTON:
  33. return {
  34. ...state,
  35. disabled
  36. };
  37. default:
  38. return state;
  39. }
  40. });