2021-04-12 07:37:39 +00:00
|
|
|
|
2022-09-01 11:00:49 +00:00
|
|
|
import ReducerRegistry from '../base/redux/ReducerRegistry';
|
2021-04-12 07:37:39 +00:00
|
|
|
|
2022-03-15 17:24:49 +00:00
|
|
|
import {
|
|
|
|
SET_SCREENSHARE_CAPTURE_FRAME_RATE,
|
2022-09-27 07:10:28 +00:00
|
|
|
SET_SCREENSHARE_TRACKS,
|
|
|
|
SET_SCREEN_AUDIO_SHARE_STATE
|
2022-03-15 17:24:49 +00:00
|
|
|
} from './actionTypes';
|
2021-04-12 07:37:39 +00:00
|
|
|
|
2022-09-01 11:00:49 +00:00
|
|
|
export interface IScreenShareState {
|
|
|
|
captureFrameRate?: number;
|
2022-10-06 17:18:22 +00:00
|
|
|
desktopAudioTrack?: any;
|
2022-09-01 11:00:49 +00:00
|
|
|
isSharingAudio?: boolean;
|
|
|
|
}
|
|
|
|
|
2021-04-12 07:37:39 +00:00
|
|
|
/**
|
|
|
|
* Reduces the Redux actions of the feature features/screen-share.
|
|
|
|
*/
|
2022-09-05 09:05:07 +00:00
|
|
|
ReducerRegistry.register<IScreenShareState>('features/screen-share', (state = {}, action): IScreenShareState => {
|
2022-03-15 17:24:49 +00:00
|
|
|
const { captureFrameRate, isSharingAudio, desktopAudioTrack } = action;
|
2021-04-12 07:37:39 +00:00
|
|
|
|
|
|
|
switch (action.type) {
|
|
|
|
case SET_SCREEN_AUDIO_SHARE_STATE:
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
isSharingAudio
|
|
|
|
};
|
|
|
|
|
2021-06-28 07:48:16 +00:00
|
|
|
case SET_SCREENSHARE_CAPTURE_FRAME_RATE:
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
captureFrameRate
|
|
|
|
};
|
|
|
|
|
2022-03-15 17:24:49 +00:00
|
|
|
case SET_SCREENSHARE_TRACKS:
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
desktopAudioTrack
|
|
|
|
};
|
|
|
|
|
2021-04-12 07:37:39 +00:00
|
|
|
default:
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
});
|