feat(prejoin) cache media start options when on prejoin screen

This commit is contained in:
Tudor-Ovidiu Avram 2020-06-29 10:45:28 +03:00 committed by Saúl Ibarra Corretgé
parent bd65108692
commit f376542441
1 changed files with 20 additions and 0 deletions

View File

@ -1,11 +1,13 @@
// @flow
import { SET_AUDIO_MUTED, SET_VIDEO_MUTED } from '../base/media';
import { MiddlewareRegistry } from '../base/redux';
import { updateSettings } from '../base/settings';
import { getLocalVideoTrack, replaceLocalTrack } from '../base/tracks';
import { PREJOIN_START_CONFERENCE } from './actionTypes';
import { setPrejoinPageVisibility } from './actions';
import { isPrejoinPageVisible } from './functions';
declare var APP: Object;
@ -38,8 +40,26 @@ MiddlewareRegistry.register(store => next => async action => {
break;
}
case SET_AUDIO_MUTED: {
if (isPrejoinPageVisible(store.getState())) {
store.dispatch(updateSettings({
startWithAudioMuted: Boolean(action.muted)
}));
}
break;
}
case SET_VIDEO_MUTED: {
if (isPrejoinPageVisible(store.getState())) {
store.dispatch(updateSettings({
startWithVideoMuted: Boolean(action.muted)
}));
}
break;
}
}
return next(action);
});