Skip to content

Commit 02c07b5

Browse files
author
arthur
committed
# <type>: (If applied, this commit will...) <subject> (Max 50 char)
# |<---- Using a Maximum Of 50 Characters ---->| add packetLostRate # Explain why this change is being made # |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->| # Provide links or keys to any relevant tickets, articles or other resources # Example: Github issue muaz-khan#23 # --- COMMIT END --- # Type can be # feat (new feature) # fix (bug fix) # refactor (refactoring production code) # style (formatting, missing semi colons, etc; no code change) # docs (changes to documentation) # test (adding or refactoring tests; no production code change) # chore (updating grunt tasks etc; no production code change) # -------------------- # Remember to # Capitalize the subject line # Use the imperative mood in the subject line # Do not end the subject line with a period # Separate subject from body with a blank line # Use the body to explain what and why vs. how # Can use multiple lines with "-" for bullet points in body # -------------------- # For more information about this template, check out # https://gist.github.com/adeekshith/cd4c95a064977cdc6c50
1 parent 75c4364 commit 02c07b5

File tree

3 files changed

+592
-568
lines changed

3 files changed

+592
-568
lines changed

dev/googCodecName.video.js

+12
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,17 @@ getStatsParser.checkVideoTracks = function(result) {
2525
kilobytes = bytes / 1024;
2626
}
2727

28+
if (!!result.packetsLost) {
29+
var kilolostPackets = 0;
30+
31+
if (!getStatsResult.internal.video[sendrecvType].prevLostPacket) {
32+
getStatsResult.internal.video[sendrecvType].prevLostPacket = result.packetsLost;
33+
}
34+
35+
var packets = result.packetsLost - getStatsResult.internal.video[sendrecvType].packetsLost;
36+
kilolostPackets = packets / 1024
37+
}
38+
2839
if (!!result.bytesReceived) {
2940
var kilobytes = 0;
3041
if (!getStatsResult.internal.video[sendrecvType].prevBytesReceived) {
@@ -38,6 +49,7 @@ getStatsParser.checkVideoTracks = function(result) {
3849
}
3950

4051
getStatsResult.video[sendrecvType].availableBandwidth = kilobytes.toFixed(1);
52+
getStatsResult.video[sendrecvType].packetsLostRate = (kilolostPackets / kilobytes).toFixed(1);
4153

4254
if (result.googFrameHeightReceived && result.googFrameWidthReceived) {
4355
getStatsResult.resolutions[sendrecvType].width = result.googFrameWidthReceived;

0 commit comments

Comments
 (0)