Selaa lähdekoodia

refactor: Don't calculate remote connection quality.

master
Boris Grozev 9 vuotta sitten
vanhempi
commit
813ac81f83
1 muutettua tiedostoa jossa 7 lisäystä ja 21 poistoa
  1. 7
    21
      modules/connectivity/ConnectionQuality.js

+ 7
- 21
modules/connectivity/ConnectionQuality.js Näytä tiedosto

85
          */
85
          */
86
         this.remoteStats = {};
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
         conference.on(ConferenceEvents.CONNECTION_INTERRUPTED,
88
         conference.on(ConferenceEvents.CONNECTION_INTERRUPTED,
95
                       () => { this._updateLocalConnectionQuality(0); });
89
                       () => { this._updateLocalConnectionQuality(0); });
96
 
90
 
111
         conference.on(
105
         conference.on(
112
             ConferenceEvents.CONNECTION_STATS,
106
             ConferenceEvents.CONNECTION_STATS,
113
             (stats) => {
107
             (stats) => {
114
-                let localVideoTracks = conference.getLocalTracks(MediaType.VIDEO);
108
+                let localVideoTracks =
109
+                    conference.getLocalTracks(MediaType.VIDEO);
115
                 let localVideoTrack
110
                 let localVideoTrack
116
                     = localVideoTracks.length > 0 ? localVideoTracks[0] : null;
111
                     = localVideoTracks.length > 0 ? localVideoTracks[0] : null;
117
 
112
 
239
                 this.eventEmitter.emit(
234
                 this.eventEmitter.emit(
240
                     ConnectionQualityEvents.REMOTE_STATS_UPDATED,
235
                     ConnectionQualityEvents.REMOTE_STATS_UPDATED,
241
                     id,
236
                     id,
242
-                    null,
243
                     null);
237
                     null);
244
                 return;
238
                 return;
245
             }
239
             }
246
 
240
 
247
-            let inputResolution = data.resolution;
248
             // Use only the fields we need
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
             this.eventEmitter.emit(
249
             this.eventEmitter.emit(
263
                 ConnectionQualityEvents.REMOTE_STATS_UPDATED,
250
                 ConnectionQualityEvents.REMOTE_STATS_UPDATED,
264
                 id,
251
                 id,
265
-                this.remoteConnectionQuality[id],
266
                 this.remoteStats[id]);
252
                 this.remoteStats[id]);
267
     }
253
     }
268
 
254
 

Loading…
Peruuta
Tallenna