1
1
'use strict' ;
2
2
3
- // Last time updated: 2018-08-30 6:37:37 AM UTC
3
+ // Last time updated: 2018-08-30 9:15:50 AM UTC
4
4
5
5
// _______________
6
6
// getStats v1.0.7
@@ -311,17 +311,6 @@ window.getStats = function(mediaStreamTrack, callback, interval) {
311
311
kilobytes = bytes / 1024 ;
312
312
}
313
313
314
- if ( ! ! result . packetsLost ) {
315
- var kilolostPackets = 0 ;
316
-
317
- if ( ! getStatsResult . internal . video [ sendrecvType ] . prevLostPacket ) {
318
- getStatsResult . internal . video [ sendrecvType ] . prevLostPacket = result . packetsLost ;
319
- }
320
-
321
- var packets = result . packetsLost - getStatsResult . internal . video [ sendrecvType ] . prevLostPacket ;
322
- kilolostPackets = packets / 1024
323
- }
324
-
325
314
if ( ! ! result . bytesReceived ) {
326
315
var kilobytes = 0 ;
327
316
if ( ! getStatsResult . internal . video [ sendrecvType ] . prevBytesReceived ) {
@@ -335,8 +324,18 @@ window.getStats = function(mediaStreamTrack, callback, interval) {
335
324
}
336
325
337
326
getStatsResult . video [ sendrecvType ] . availableBandwidth = kilobytes . toFixed ( 1 ) ;
338
- getStatsResult . video [ sendrecvType ] . packetsLostRate = ( kilolostPackets / kilobytes ) . toFixed ( 1 ) ;
339
327
328
+ if ( ! ! result . packetsLost ) {
329
+ var kilolostPackets = 0 ;
330
+
331
+ if ( ! getStatsResult . internal . video [ sendrecvType ] . prevLostPacket ) {
332
+ getStatsResult . internal . video [ sendrecvType ] . prevLostPacket = result . packetsLost ;
333
+ }
334
+
335
+ var packets = result . packetsLost - getStatsResult . internal . video [ sendrecvType ] . prevLostPacket ;
336
+ kilolostPackets = packets / 1024 ;
337
+ getStatsResult . video [ sendrecvType ] . packetsLostRate = ( kilolostPackets / kilobytes ) . toFixed ( 1 ) ;
338
+ }
340
339
if ( result . googFrameHeightReceived && result . googFrameWidthReceived ) {
341
340
getStatsResult . resolutions [ sendrecvType ] . width = result . googFrameWidthReceived ;
342
341
getStatsResult . resolutions [ sendrecvType ] . height = result . googFrameHeightReceived ;
0 commit comments