yangjie #28

Merged
yangqiang merged 32 commits from yangjie into master 2024-10-29 15:15:48 +08:00
1 changed files with 9 additions and 6 deletions
Showing only changes of commit 2c15e96c77 - Show all commits

View File

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