This commit is contained in:
parent
01c642c0e9
commit
dece2d8418
|
|
@ -174,22 +174,13 @@ const Meeting: React.FC = () => {
|
|||
})
|
||||
},
|
||||
onAudioVolumeIndication: async (speakers: any) => {
|
||||
setRoomUserList((res: any) => {
|
||||
speakers.forEach((item: any) => {
|
||||
if (item.uid) {
|
||||
let itemUser = res.find((row: any) => row.uid === String(item.uid))
|
||||
if (itemUser) {
|
||||
itemUser.volumeNumber = (item.volume / 255) * 100;
|
||||
}
|
||||
} else {
|
||||
let me = res.find((row: any) => row.uid === userInfo.uid)
|
||||
if (me) {
|
||||
me.volumeNumber = (item.volume / 255) * 100;
|
||||
}
|
||||
}
|
||||
});
|
||||
return res
|
||||
})
|
||||
speakers.forEach((item: any) => {
|
||||
let dom = document.getElementById(`micr-${item.uid ? item.uid : userInfo.uid}`);
|
||||
if (dom) {
|
||||
const percentage = (item.volume / 255) * 100
|
||||
dom.style.width = `${percentage}%`
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
agora.startCameraCapture()
|
||||
|
|
@ -988,7 +979,7 @@ const Meeting: React.FC = () => {
|
|||
</div>
|
||||
</Popover>
|
||||
<div className={styles.meetingContentSwiperCardBorder}>
|
||||
{item.enableMicr ? <div style={{ width: `${item.volumeNumber}%` }}></div> : null}
|
||||
{item.enableMicr ? <div id={`micr-${item.uid}`}></div> : null}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,6 +87,7 @@ const agora = {
|
|||
if (setting.playBackVolume) agora.setPlaybackDeviceVolume(setting.playBackVolume) // 设置播放设备音量
|
||||
if (setting.ecordingDeviceId) agora.setRecordingDevice(setting.ecordingDeviceId) // 设置音频采集设备
|
||||
if (setting.ecordingVolume) agora.setRecordingDeviceVolume(setting.ecordingVolume) // 设置音频设备音量
|
||||
rtcEngine.enableAudioVolumeIndication(100, 1, true)
|
||||
}
|
||||
}, 1000);
|
||||
},
|
||||
|
|
@ -186,7 +187,6 @@ const agora = {
|
|||
},
|
||||
// 加入频道
|
||||
joinChannel: () => {
|
||||
// rtcEngine.enableAudioVolumeIndication(200, 10, true)
|
||||
rtcEngine.joinChannel(option.token, option.channelId, option.uid, {
|
||||
autoSubscribeAudio: true,//设置是否自动订阅所有音频流
|
||||
autoSubscribeVideo: true,//设置是否自动订阅所有视频流
|
||||
|
|
|
|||
Loading…
Reference in New Issue