This commit is contained in:
parent
d925cdb74d
commit
2c15e96c77
|
|
@ -608,12 +608,15 @@ const AudioComponents = () => {
|
||||||
getAudioMediaList()
|
getAudioMediaList()
|
||||||
agora.registerEventHandler({
|
agora.registerEventHandler({
|
||||||
onAudioVolumeIndication: (speakers: any) => {
|
onAudioVolumeIndication: (speakers: any) => {
|
||||||
const totalVolume = speakers.length ? speakers[0].volume : 0
|
speakers.forEach((item: any) => {
|
||||||
const percentage = (totalVolume / 255) * 100
|
if (item.uid === 0 || item.uid === 1) {
|
||||||
const dom = document.getElementById('deviceTest') as any;
|
const percentage = (item.volume / 255) * 100
|
||||||
if (dom) {
|
const dom = document.getElementById('deviceTest') as any;
|
||||||
dom.style.width = `${percentage}%`
|
if (dom) {
|
||||||
}
|
dom.style.width = `${percentage}%`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}, []);
|
}, []);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue