Skip to content

Commit

Permalink
Enable availableOutgoingBitrate stat
Browse files Browse the repository at this point in the history
  • Loading branch information
vpalmisano committed Aug 24, 2023
1 parent 6cf81a6 commit fbc3e57
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/rtcstats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ export enum RtcStatsMetricNames {
screenRecvWidth = 'screenRecvWidth',
//'screenTotalDecodeTime',
screenTotalFreezesDuration = 'screenTotalFreezesDuration',

/** The transport availableOutgoingBitrate stat. */
transportSentAvailableOutgoingBitrate = 'transportSentAvailableOutgoingBitrate',
}

/**
Expand Down Expand Up @@ -249,7 +252,7 @@ export function updateRtcStats(
videoSentMaxBitrate,
isDisplay,
codec,
// availableOutgoingBitrate,
availableOutgoingBitrate,
} = value
const hostName = signalingHost || remoteAddress
const key = `${trackId}:${hostName}:${codec}`
Expand Down Expand Up @@ -403,6 +406,12 @@ export function updateRtcStats(
key,
outboundRtp.transportRoundTripTime,
)
setStats(
stats,
('transportSentAvailableOutgoingBitrate') as RtcStatsMetricNames,
key,
availableOutgoingBitrate,
)
if (outboundRtp.kind === 'video') {
setStats(
stats,
Expand Down

0 comments on commit fbc3e57

Please sign in to comment.