From 379a794bd7a957b625a9851eb2af155f797228ba Mon Sep 17 00:00:00 2001 From: Adam Shiervani Date: Thu, 28 Aug 2025 12:35:23 +0200 Subject: [PATCH] feat: Dont collect stats without a video track --- ui/src/components/sidebar/connectionStats.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/src/components/sidebar/connectionStats.tsx b/ui/src/components/sidebar/connectionStats.tsx index dc00c8a..0d65afd 100644 --- a/ui/src/components/sidebar/connectionStats.tsx +++ b/ui/src/components/sidebar/connectionStats.tsx @@ -29,6 +29,10 @@ export default function ConnectionStatsSidebar() { useInterval(function collectWebRTCStats() { (async () => { if (!mediaStream) return; + + const videoTrack = mediaStream.getVideoTracks()[0]; + if (!videoTrack) return; + const stats = await peerConnection?.getStats(); let successfulLocalCandidateId: string | null = null; let successfulRemoteCandidateId: string | null = null;