This commit is contained in:
parent
d70f09f82d
commit
170ff9b122
|
|
@ -14,12 +14,11 @@ const CurrentSpeakUserWindow: React.FC = () => {
|
|||
switch (type) {
|
||||
case 'currentSpeakUser':
|
||||
if (currentSpeakUser.length) {
|
||||
setInputValue(currentSpeakUser.join('; '))
|
||||
setIsMeSpeack(uidArr.find((item: any) => item === 0) ? true : false)
|
||||
setInputValue(currentSpeakUser.join(';'))
|
||||
} else {
|
||||
setInputValue('')
|
||||
setIsMeSpeack(false)
|
||||
}
|
||||
setIsMeSpeack(uidArr.find((item: any) => item === 0) === 0 ? true : false)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -29,8 +28,8 @@ const CurrentSpeakUserWindow: React.FC = () => {
|
|||
return (
|
||||
<>
|
||||
<div className={styles.currentSpeakUserWindow}>
|
||||
<div title={`正在说话:${isMeSpeack ? user.userName : ''} ${inputValue}`}>
|
||||
{`正在说话:${isMeSpeack ? user.userName : ''} ${inputValue}`}
|
||||
<div title={`正在说话:${isMeSpeack ? user.userName + ';' : ''} ${inputValue}`}>
|
||||
{`正在说话:${isMeSpeack ? user.userName + ';' : ''} ${inputValue}`}
|
||||
</div>
|
||||
</div >
|
||||
</>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import styles from '@/page/Meeting/NoticeWindow/index.module.scss'
|
||||
import { setKeyOpenChildWindow } from '@/utils/package/public';
|
||||
import { Button, notification } from 'antd';
|
||||
import { useEffect } from "react";
|
||||
|
||||
|
|
@ -80,8 +79,8 @@ const NoticeWindow: React.FC = () => {
|
|||
const dom = document.getElementsByClassName('ant-notification')
|
||||
if (dom.length === 0) {
|
||||
window.electron.setChildWindow({
|
||||
height: 0,
|
||||
window: 0,
|
||||
height: 1,
|
||||
width: 1,
|
||||
key: 'noticeWindow',
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -916,24 +916,27 @@ const Meeting: React.FC = () => {
|
|||
}
|
||||
},
|
||||
onAudioVolumeIndication: async (speakers: AudioVolumeInfo[]) => {
|
||||
async function checkUidsInUsers(uids: number[]): Promise<string[]> {
|
||||
return new Promise<string[]>(resolve => {
|
||||
const usernames: string[] = [];
|
||||
function checkUidsInUsers(uids: number[]): string[] {
|
||||
const usernames: string[] = [];
|
||||
setRoomUserList((res: any) => {
|
||||
uids.forEach(uid => {
|
||||
setRoomUserList((res: any) => {
|
||||
const user = res.find((item: any) => item.uid == uid);
|
||||
if (user) {
|
||||
usernames.push(user.userName);
|
||||
}
|
||||
return res
|
||||
})
|
||||
});
|
||||
if (uids.length === usernames.length) {
|
||||
resolve(usernames)
|
||||
}
|
||||
})
|
||||
const user = res.find((item: any) => item.uid == uid);
|
||||
if (user) {
|
||||
usernames.push(user.userName);
|
||||
}
|
||||
})
|
||||
return res
|
||||
});
|
||||
return usernames
|
||||
}
|
||||
if (speakers.length) {
|
||||
const uidArr = (speakers.filter((item: any) => item.volume)).map(item => item.uid) as number[];
|
||||
const currentSpeakUser = checkUidsInUsers(uidArr)
|
||||
channel.postMessage({
|
||||
type: 'currentSpeakUser',
|
||||
currentSpeakUser,
|
||||
uidArr
|
||||
});
|
||||
speakers.forEach((item: any) => {
|
||||
let domMe = document.getElementById(`micr-item-${userInfo.uid}`);
|
||||
let dom = document.getElementById(`micr-${item.uid ? item.uid : userInfo.uid}`);
|
||||
|
|
@ -950,13 +953,6 @@ const Meeting: React.FC = () => {
|
|||
});
|
||||
}
|
||||
});
|
||||
const uidArr = (speakers.filter((item: any) => item.volume)) as number[];
|
||||
const currentSpeakUser = await checkUidsInUsers(uidArr)
|
||||
channel.postMessage({
|
||||
type: 'currentSpeakUser',
|
||||
currentSpeakUser,
|
||||
uidArr
|
||||
});
|
||||
}
|
||||
},
|
||||
onNetworkQuality: async (_connection: RtcConnection, remoteUid: number, _txQuality: QualityType, rxQuality: QualityType) => {
|
||||
|
|
@ -1535,8 +1531,8 @@ const Meeting: React.FC = () => {
|
|||
})
|
||||
window.electron.createChildWindow({
|
||||
url: location.origin + `/#/noticeWindow`,
|
||||
width: 388,
|
||||
height: 150,
|
||||
width: 1,
|
||||
height: 1,
|
||||
key: 'noticeWindow',
|
||||
})
|
||||
setKeyOpenChildWindow('shareScreenWindow', true)
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@ export const agora = {
|
|||
},
|
||||
// 加入频道
|
||||
joinChannel: async () => {
|
||||
await rtcEngine.enableAudioVolumeIndication(100, 3, true)
|
||||
await rtcEngine.enableAudioVolumeIndication(1000, 3, true)
|
||||
await rtcEngine.joinChannel(option.token, option.channelId, option.uid);
|
||||
await rtcEngine.setDualStreamModeEx(
|
||||
SimulcastStreamMode.EnableSimulcastStream,
|
||||
|
|
|
|||
Loading…
Reference in New Issue