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}%` + } + } + }); } }) }, []);