Pārlūkot izejas kodu

refactor: Don't calculate remote connection quality.

master
Boris Grozev 9 gadus atpakaļ
vecāks
revīzija
813ac81f83
1 mainītis faili ar 7 papildinājumiem un 21 dzēšanām
  1. 7
    21
      modules/connectivity/ConnectionQuality.js

+ 7
- 21
modules/connectivity/ConnectionQuality.js Parādīt failu

@@ -85,12 +85,6 @@ export default class ConnectionQuality {
85 85
          */
86 86
         this.remoteStats = {};
87 87
 
88
-        /**
89
-         * Quality percent( 100% - good, 0% - bad.) stored per id.
90
-         * TODO remove, read from the received remote stats
91
-         */
92
-        this.remoteConnectionQuality = {};
93
-
94 88
         conference.on(ConferenceEvents.CONNECTION_INTERRUPTED,
95 89
                       () => { this._updateLocalConnectionQuality(0); });
96 90
 
@@ -111,7 +105,8 @@ export default class ConnectionQuality {
111 105
         conference.on(
112 106
             ConferenceEvents.CONNECTION_STATS,
113 107
             (stats) => {
114
-                let localVideoTracks = conference.getLocalTracks(MediaType.VIDEO);
108
+                let localVideoTracks =
109
+                    conference.getLocalTracks(MediaType.VIDEO);
115 110
                 let localVideoTrack
116 111
                     = localVideoTracks.length > 0 ? localVideoTracks[0] : null;
117 112
 
@@ -239,30 +234,21 @@ export default class ConnectionQuality {
239 234
                 this.eventEmitter.emit(
240 235
                     ConnectionQualityEvents.REMOTE_STATS_UPDATED,
241 236
                     id,
242
-                    null,
243 237
                     null);
244 238
                 return;
245 239
             }
246 240
 
247
-            let inputResolution = data.resolution;
248 241
             // Use only the fields we need
249
-            data = {bitrate: data.bitrate, packetLoss: data.packetLoss};
250
-
251
-            this.remoteStats[id] = data;
242
+            this.remoteStats[id] = {
243
+                bitrate: data.bitrate,
244
+                packetLoss: data.packetLoss,
245
+                connectionQuality: data.connectionQuality
246
+            };
252 247
 
253
-            let val = this._getNewQualityValue(
254
-                data,
255
-                this.remoteConnectionQuality[id],
256
-                remoteVideoType,
257
-                isRemoteVideoMuted,
258
-                inputResolution);
259
-            if (val !== undefined)
260
-                this.remoteConnectionQuality[id] = val;
261 248
 
262 249
             this.eventEmitter.emit(
263 250
                 ConnectionQualityEvents.REMOTE_STATS_UPDATED,
264 251
                 id,
265
-                this.remoteConnectionQuality[id],
266 252
                 this.remoteStats[id]);
267 253
     }
268 254
 

Notiek ielāde…
Atcelt
Saglabāt