Files
jitsi-meet/react/features/video-layout/middleware.web.js
Leonard Kim 57f7abc6dd ref(video-layout): get dominant speaker state from redux
Instead of keeping dominant speaker locally, get it from redux and be
updated when the dominant speaker changes. This is in an attempt to mimic
the video layout being reactified and connected to redux.
2018-06-01 10:42:57 -07:00

26 lines
806 B
JavaScript

import VideoLayout from '../../../modules/UI/videolayout/VideoLayout.js';
import { DOMINANT_SPEAKER_CHANGED } from '../base/participants';
import { MiddlewareRegistry } from '../base/redux';
/**
* Middleware which intercepts actions and updates the legacy component
* {@code VideoLayout} as needed. The purpose of this middleware is to redux-ify
* {@code VideoLayout} without having to simultaneously react-ifying it.
*
* @param {Store} store - The redux store.
* @returns {Function}
*/
// eslint-disable-next-line no-unused-vars
MiddlewareRegistry.register(store => next => action => {
const result = next(action);
switch (action.type) {
case DOMINANT_SPEAKER_CHANGED:
VideoLayout.onDominantSpeakerChanged(action.participant.id);
break;
}
return result;
});