From 6fff5758177fbd9e01f4eebdb920be2e49f7fb95 Mon Sep 17 00:00:00 2001 From: sergystepanov Date: Sat, 6 Jun 2026 22:52:53 +0300 Subject: [PATCH] Use state from the WebRTC stat reports for RTT Previous fix #844d84b doesn't work in Chrome, so this is another method for better FF/Chrome compatibility. --- web/js/app.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/web/js/app.js b/web/js/app.js index f5cc9029..bb0ced7d 100755 --- a/web/js/app.js +++ b/web/js/app.js @@ -642,8 +642,12 @@ stats.modules = [ ); SET_CODEC = 1; } - const { selected, currentRoundTripTime, type, kind } = report; - if (selected && currentRoundTripTime !== undefined) { + const { selected, state, currentRoundTripTime, type, kind } = + report; + if ( + (selected || state === "succeeded") && + currentRoundTripTime !== undefined + ) { WEBRTC_STATS_RTT(currentRoundTripTime * 1000); } if (type === "inbound-rtp" && kind === "video") {