Use RTT stats from the selected ICE pair in the stats

This commit is contained in:
sergystepanov 2026-06-06 12:58:23 +03:00
parent eaed44a03f
commit 844d84b6ac

View file

@ -647,8 +647,8 @@ stats.modules = [
); );
SET_CODEC = 1; SET_CODEC = 1;
} }
const { nominated, currentRoundTripTime, type, kind } = report; const { selected, currentRoundTripTime, type, kind } = report;
if (nominated && currentRoundTripTime !== undefined) { if (selected && currentRoundTripTime !== undefined) {
WEBRTC_STATS_RTT(currentRoundTripTime * 1000); WEBRTC_STATS_RTT(currentRoundTripTime * 1000);
} }
if (type === "inbound-rtp" && kind === "video") { if (type === "inbound-rtp" && kind === "video") {