Skip to content

Commit 877d113

Browse files
author
arthur
committed
refactor: packetsLostRate
1 parent 99a997b commit 877d113

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

dev/googCodecName.video.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ getStatsParser.checkVideoTracks = function(result) {
4848

4949
var packets = result.packetsLost - getStatsResult.internal.video[sendrecvType].prevLostPacket;
5050
kilolostPackets = packets / 1024;
51-
getStatsResult.video[sendrecvType].packetsLostRate = (kilolostPackets / kilobytes).toFixed(1);
51+
getStatsResult.video[sendrecvType].packetsLostRate = (kilolostPackets / kilobytes).toFixed(4) * 100 + "%";
5252
}
5353
if (result.googFrameHeightReceived && result.googFrameWidthReceived) {
5454
getStatsResult.resolutions[sendrecvType].width = result.googFrameWidthReceived;

getStats.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
// Last time updated: 2018-08-30 9:15:50 AM UTC
3+
// Last time updated: 2018-08-30 9:35:45 AM UTC
44

55
// _______________
66
// getStats v1.0.7
@@ -334,7 +334,7 @@ window.getStats = function(mediaStreamTrack, callback, interval) {
334334

335335
var packets = result.packetsLost - getStatsResult.internal.video[sendrecvType].prevLostPacket;
336336
kilolostPackets = packets / 1024;
337-
getStatsResult.video[sendrecvType].packetsLostRate = (kilolostPackets / kilobytes).toFixed(1);
337+
getStatsResult.video[sendrecvType].packetsLostRate = (kilolostPackets / kilobytes).toFixed(4) * 100 + "%";
338338
}
339339
if (result.googFrameHeightReceived && result.googFrameWidthReceived) {
340340
getStatsResult.resolutions[sendrecvType].width = result.googFrameWidthReceived;

0 commit comments

Comments
 (0)