Skip to content

Commit

Permalink
refactor: packetsLostRate
Browse files Browse the repository at this point in the history
  • Loading branch information
arthur committed Aug 30, 2018
1 parent 99a997b commit 877d113
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dev/googCodecName.video.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ getStatsParser.checkVideoTracks = function(result) {

var packets = result.packetsLost - getStatsResult.internal.video[sendrecvType].prevLostPacket;
kilolostPackets = packets / 1024;
getStatsResult.video[sendrecvType].packetsLostRate = (kilolostPackets / kilobytes).toFixed(1);
getStatsResult.video[sendrecvType].packetsLostRate = (kilolostPackets / kilobytes).toFixed(4) * 100 + "%";
}
if (result.googFrameHeightReceived && result.googFrameWidthReceived) {
getStatsResult.resolutions[sendrecvType].width = result.googFrameWidthReceived;
Expand Down
4 changes: 2 additions & 2 deletions getStats.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

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

// _______________
// getStats v1.0.7
Expand Down Expand Up @@ -334,7 +334,7 @@ window.getStats = function(mediaStreamTrack, callback, interval) {

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

0 comments on commit 877d113

Please sign in to comment.