mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-05-01 11:30:17 +00:00
Move away from middleware and instead update video quality when the selected video quality updates in redux. This also lead to removing of automatically exiting audio only because with the change it's not so readily possible to tell if the user switched off audio only by re-selecting the already preferred video quality. Removing this automagic removed some additional checking done for mobile.
51 lines
1.3 KiB
JavaScript
51 lines
1.3 KiB
JavaScript
// @flow
|
|
|
|
import { appNavigate } from '../app';
|
|
import {
|
|
CONFERENCE_JOINED,
|
|
KICKED_OUT,
|
|
VIDEO_QUALITY_LEVELS,
|
|
conferenceFailed,
|
|
setPreferredReceiverVideoQuality
|
|
} from '../base/conference';
|
|
import { JitsiConferenceEvents } from '../base/lib-jitsi-meet';
|
|
import { SET_REDUCED_UI } from '../base/responsive-ui';
|
|
import { MiddlewareRegistry } from '../base/redux';
|
|
import { setFilmstripEnabled } from '../filmstrip';
|
|
import { setToolboxEnabled } from '../toolbox';
|
|
|
|
MiddlewareRegistry.register(store => next => action => {
|
|
const result = next(action);
|
|
|
|
switch (action.type) {
|
|
case CONFERENCE_JOINED:
|
|
case SET_REDUCED_UI: {
|
|
const { dispatch, getState } = store;
|
|
const state = getState();
|
|
const { reducedUI } = state['features/base/responsive-ui'];
|
|
|
|
dispatch(setToolboxEnabled(!reducedUI));
|
|
dispatch(setFilmstripEnabled(!reducedUI));
|
|
|
|
dispatch(
|
|
setPreferredReceiverVideoQuality(
|
|
reducedUI
|
|
? VIDEO_QUALITY_LEVELS.LOW
|
|
: VIDEO_QUALITY_LEVELS.HIGH));
|
|
|
|
break;
|
|
}
|
|
|
|
case KICKED_OUT: {
|
|
const { dispatch } = store;
|
|
|
|
dispatch(
|
|
conferenceFailed(action.conference, JitsiConferenceEvents.KICKED));
|
|
dispatch(appNavigate(undefined));
|
|
break;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
});
|