From 2c15e96c770a77d73fd6bc83a053fa74db151b0c Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Mon, 28 Oct 2024 13:43:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/StupWizard/index.tsx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/components/StupWizard/index.tsx b/src/components/StupWizard/index.tsx index 9d2ec6f..9e09414 100644 --- a/src/components/StupWizard/index.tsx +++ b/src/components/StupWizard/index.tsx @@ -608,12 +608,15 @@ const AudioComponents = () => { getAudioMediaList() agora.registerEventHandler({ onAudioVolumeIndication: (speakers: any) => { - const totalVolume = speakers.length ? speakers[0].volume : 0 - const percentage = (totalVolume / 255) * 100 - const dom = document.getElementById('deviceTest') as any; - if (dom) { - dom.style.width = `${percentage}%` - } + speakers.forEach((item: any) => { + if (item.uid === 0 || item.uid === 1) { + const percentage = (item.volume / 255) * 100 + const dom = document.getElementById('deviceTest') as any; + if (dom) { + dom.style.width = `${percentage}%` + } + } + }); } }) }, []);