Skip to content

Commit

Permalink
# <type>: (If applied, this commit will...) <subject> (Max 50 char)
Browse files Browse the repository at this point in the history
# |<----  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
  • Loading branch information
arthur committed Aug 30, 2018
1 parent 75c4364 commit 02c07b5
Show file tree
Hide file tree
Showing 3 changed files with 592 additions and 568 deletions.
12 changes: 12 additions & 0 deletions dev/googCodecName.video.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ getStatsParser.checkVideoTracks = function(result) {
kilobytes = bytes / 1024;
}

if (!!result.packetsLost) {
var kilolostPackets = 0;

if (!getStatsResult.internal.video[sendrecvType].prevLostPacket) {
getStatsResult.internal.video[sendrecvType].prevLostPacket = result.packetsLost;
}

var packets = result.packetsLost - getStatsResult.internal.video[sendrecvType].packetsLost;
kilolostPackets = packets / 1024
}

if (!!result.bytesReceived) {
var kilobytes = 0;
if (!getStatsResult.internal.video[sendrecvType].prevBytesReceived) {
Expand All @@ -38,6 +49,7 @@ getStatsParser.checkVideoTracks = function(result) {
}

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

if (result.googFrameHeightReceived && result.googFrameWidthReceived) {
getStatsResult.resolutions[sendrecvType].width = result.googFrameWidthReceived;
Expand Down
Loading

1 comment on commit 02c07b5

@Talbot3
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

support packetLostRate

Please sign in to comment.