ref(stats): start the statsEmitter for both mobile and web

Moves the statsEmitter.start() invocation to the middleware of
the connection-indicator feature, so that it's started for both mobile
and web (now mobile needs RTP stats for the tests).
This commit is contained in:
paweldomas 2018-03-07 09:19:01 -06:00 committed by Дамян Минков
parent 3f99e80358
commit 461540d874
3 changed files with 27 additions and 3 deletions

View File

@ -94,7 +94,6 @@ import {
getLocationContextRoot,
getJitsiMeetGlobalNS
} from './react/features/base/util';
import { statsEmitter } from './react/features/connection-indicator';
import { showDesktopPicker } from './react/features/desktop-picker';
import { appendSuffix } from './react/features/display-name';
import {
@ -2079,8 +2078,6 @@ export default {
}
});
statsEmitter.startListeningForStats(room);
room.addCommandListener(this.commands.defaults.ETHERPAD,
({ value }) => {
APP.UI.initEtherpad(value);

View File

@ -1,3 +1,5 @@
export * from './components';
export { default as statsEmitter } from './statsEmitter';
import './middleware';

View File

@ -0,0 +1,25 @@
// @flow
import { MiddlewareRegistry } from '../base/redux';
import { CONFERENCE_JOINED } from '../base/conference';
import { statsEmitter } from './index';
/**
* Implements the middleware of the feature connection-indicator.
*
* @param {Store} store - The redux store.
* @returns {Function}
*/
// eslint-disable-next-line no-unused-vars
MiddlewareRegistry.register(store => next => action => {
switch (action.type) {
case CONFERENCE_JOINED: {
statsEmitter.startListeningForStats(action.conference);
break;
}
}
return next(action);
});