Преглед на файлове

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).
master
paweldomas преди 7 години
родител
ревизия
461540d874
променени са 3 файла, в които са добавени 27 реда и са изтрити 3 реда
  1. 0
    3
      conference.js
  2. 2
    0
      react/features/connection-indicator/index.js
  3. 25
    0
      react/features/connection-indicator/middleware.js

+ 0
- 3
conference.js Целия файл

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

+ 2
- 0
react/features/connection-indicator/index.js Целия файл

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

+ 25
- 0
react/features/connection-indicator/middleware.js Целия файл

@@ -0,0 +1,25 @@
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…
Отказ
Запис