Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

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

paweldomas461540d874d9
diff --git a/conference.js b/conference.js
index 95d957d83b..403eba60b1 100644
--- a/conference.js
+++ b/conference.js
@@ -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);
diff --git a/react/features/connection-indicator/index.js b/react/features/connection-indicator/index.js
index cac632cf60..232c0a9194 100644
--- a/react/features/connection-indicator/index.js
+++ b/react/features/connection-indicator/index.js
@@ -1,3 +1,5 @@
export * from './components';
export { default as statsEmitter } from './statsEmitter';
+
+import './middleware';
diff --git a/react/features/connection-indicator/middleware.js b/react/features/connection-indicator/middleware.js
new file mode 100644
index 0000000000..3945f7dad3
--- /dev/null
+++ b/react/features/connection-indicator/middleware.js
@@ -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);
+});
+