2018-02-02 13:41:30 +00:00
|
|
|
// @flow
|
|
|
|
|
2018-03-20 18:07:51 +00:00
|
|
|
import { appNavigate } from '../app';
|
2018-02-02 13:41:30 +00:00
|
|
|
import {
|
|
|
|
CONFERENCE_JOINED,
|
2018-03-20 18:07:51 +00:00
|
|
|
KICKED_OUT,
|
2018-02-02 13:41:30 +00:00
|
|
|
VIDEO_QUALITY_LEVELS,
|
2018-03-20 18:07:51 +00:00
|
|
|
conferenceFailed,
|
2018-07-23 22:42:57 +00:00
|
|
|
setPreferredReceiverVideoQuality
|
2018-02-02 13:41:30 +00:00
|
|
|
} from '../base/conference';
|
2018-03-20 18:07:51 +00:00
|
|
|
import { JitsiConferenceEvents } from '../base/lib-jitsi-meet';
|
2018-02-02 13:41:30 +00:00
|
|
|
import { SET_REDUCED_UI } from '../base/responsive-ui';
|
|
|
|
import { MiddlewareRegistry } from '../base/redux';
|
|
|
|
import { setFilmstripEnabled } from '../filmstrip';
|
|
|
|
import { setToolboxEnabled } from '../toolbox';
|
|
|
|
|
2018-02-13 19:14:06 +00:00
|
|
|
MiddlewareRegistry.register(store => next => action => {
|
2018-02-02 13:41:30 +00:00
|
|
|
const result = next(action);
|
|
|
|
|
|
|
|
switch (action.type) {
|
|
|
|
case CONFERENCE_JOINED:
|
|
|
|
case SET_REDUCED_UI: {
|
2018-02-13 19:14:06 +00:00
|
|
|
const { dispatch, getState } = store;
|
2018-02-02 13:41:30 +00:00
|
|
|
const state = getState();
|
|
|
|
const { reducedUI } = state['features/base/responsive-ui'];
|
|
|
|
|
|
|
|
dispatch(setToolboxEnabled(!reducedUI));
|
|
|
|
dispatch(setFilmstripEnabled(!reducedUI));
|
|
|
|
|
2018-07-24 20:43:09 +00:00
|
|
|
dispatch(
|
|
|
|
setPreferredReceiverVideoQuality(
|
|
|
|
reducedUI
|
|
|
|
? VIDEO_QUALITY_LEVELS.LOW
|
|
|
|
: VIDEO_QUALITY_LEVELS.HIGH));
|
2018-02-02 13:41:30 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
2018-03-20 18:07:51 +00:00
|
|
|
|
|
|
|
case KICKED_OUT: {
|
|
|
|
const { dispatch } = store;
|
|
|
|
|
|
|
|
dispatch(
|
|
|
|
conferenceFailed(action.conference, JitsiConferenceEvents.KICKED));
|
|
|
|
dispatch(appNavigate(undefined));
|
|
|
|
break;
|
|
|
|
}
|
2018-02-02 13:41:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
});
|