优化声音视频
This commit is contained in:
parent
2a82ab22ee
commit
6ed15fff6c
|
|
@ -201,22 +201,6 @@ const Meeting: React.FC = () => {
|
|||
};
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
console.log(111);
|
||||
roomUserList.forEach((item: any) => {
|
||||
if (item.uid === user.uid) {
|
||||
const footerListTemplate = [...footerList]
|
||||
footerListTemplate[0][0].title = item.enableMicr ? '关闭声音' : '开启声音'
|
||||
footerListTemplate[0][0].active = !item.enableMicr
|
||||
footerListTemplate[0][1].title = item.enableCamera ? '关闭视频' : '开启视频'
|
||||
footerListTemplate[0][1].active = !item.enableCamera
|
||||
setFooterList(footerListTemplate)
|
||||
}
|
||||
agora.muteLocalAudioStream(!item.enableMicr)
|
||||
agora.muteLocalVideoStream(!item.enableCamera)
|
||||
});
|
||||
}, [roomUserList]);
|
||||
|
||||
useEffect(() => {
|
||||
const connection = (navigator as any).connection
|
||||
if (connection.downlink === 0) {
|
||||
|
|
@ -354,6 +338,21 @@ const Meeting: React.FC = () => {
|
|||
};
|
||||
}, [recorder])
|
||||
|
||||
const changeAgoraDevice = () => {
|
||||
console.log(roomUserList);
|
||||
roomUserList.forEach((item: any) => {
|
||||
if (item.uid === user.uid) {
|
||||
const footerListTemplate = [...footerList]
|
||||
footerListTemplate[0][0].title = item.enableMicr ? '关闭声音' : '开启声音'
|
||||
footerListTemplate[0][0].active = !item.enableMicr
|
||||
footerListTemplate[0][1].title = item.enableCamera ? '关闭视频' : '开启视频'
|
||||
footerListTemplate[0][1].active = !item.enableCamera
|
||||
setFooterList(footerListTemplate)
|
||||
}
|
||||
agora.muteLocalAudioStream(!item.enableMicr)
|
||||
agora.muteLocalVideoStream(!item.enableCamera)
|
||||
});
|
||||
}
|
||||
// 替换数据
|
||||
const setAllUserListData = (key: string, item: any): void => {
|
||||
switch (key) {
|
||||
|
|
@ -393,7 +392,7 @@ const Meeting: React.FC = () => {
|
|||
})
|
||||
break;
|
||||
}
|
||||
|
||||
changeAgoraDevice()
|
||||
}
|
||||
// 网络
|
||||
const handleNetworkChange = (): void => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue