From 9d39ccb19280c28681ccc9a2c8b7957aff050259 Mon Sep 17 00:00:00 2001 From: Takeshi NAMAO Date: Mon, 10 Jun 2024 15:31:48 +0900 Subject: [PATCH] =?UTF-8?q?LocalVideoCapability=20=E3=81=AE=E8=A1=A8?= =?UTF-8?q?=E7=A4=BA=E7=94=A8=20state=20=E3=81=AE=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Video/LocalVideoCapabilities.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/Video/LocalVideoCapabilities.tsx b/src/components/Video/LocalVideoCapabilities.tsx index 8528613c..087b6b04 100644 --- a/src/components/Video/LocalVideoCapabilities.tsx +++ b/src/components/Video/LocalVideoCapabilities.tsx @@ -82,6 +82,13 @@ const useLocalVideoTrackStats = (stream: MediaStream) => { if (selectedVideoStats.length > 0) { setSelected(selectedVideoStats[0]) } + } else { + const selectedStats = videoStats.find( + (s) => s.outboundRtpStats.rid === selected.outboundRtpStats.rid, + ) + if (selectedStats !== undefined) { + setSelected(selectedStats) + } } })() }, [statsReport, stream, selected])