Browse Source

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).
j8
paweldomas 7 years ago
parent
commit
461540d874

+ 0
- 3
conference.js View File

94
     getLocationContextRoot,
94
     getLocationContextRoot,
95
     getJitsiMeetGlobalNS
95
     getJitsiMeetGlobalNS
96
 } from './react/features/base/util';
96
 } from './react/features/base/util';
97
-import { statsEmitter } from './react/features/connection-indicator';
98
 import { showDesktopPicker } from './react/features/desktop-picker';
97
 import { showDesktopPicker } from './react/features/desktop-picker';
99
 import { appendSuffix } from './react/features/display-name';
98
 import { appendSuffix } from './react/features/display-name';
100
 import {
99
 import {
2079
             }
2078
             }
2080
         });
2079
         });
2081
 
2080
 
2082
-        statsEmitter.startListeningForStats(room);
2083
-
2084
         room.addCommandListener(this.commands.defaults.ETHERPAD,
2081
         room.addCommandListener(this.commands.defaults.ETHERPAD,
2085
             ({ value }) => {
2082
             ({ value }) => {
2086
                 APP.UI.initEtherpad(value);
2083
                 APP.UI.initEtherpad(value);

+ 2
- 0
react/features/connection-indicator/index.js View File

1
 export * from './components';
1
 export * from './components';
2
 
2
 
3
 export { default as statsEmitter } from './statsEmitter';
3
 export { default as statsEmitter } from './statsEmitter';
4
+
5
+import './middleware';

+ 25
- 0
react/features/connection-indicator/middleware.js View File

1
+// @flow
2
+
3
+import { MiddlewareRegistry } from '../base/redux';
4
+import { CONFERENCE_JOINED } from '../base/conference';
5
+
6
+import { statsEmitter } from './index';
7
+
8
+/**
9
+ * Implements the middleware of the feature connection-indicator.
10
+ *
11
+ * @param {Store} store - The redux store.
12
+ * @returns {Function}
13
+ */
14
+// eslint-disable-next-line no-unused-vars
15
+MiddlewareRegistry.register(store => next => action => {
16
+    switch (action.type) {
17
+    case CONFERENCE_JOINED: {
18
+        statsEmitter.startListeningForStats(action.conference);
19
+        break;
20
+    }
21
+    }
22
+
23
+    return next(action);
24
+});
25
+

Loading…
Cancel
Save