This commit is contained in:
parent
5550b6e950
commit
95d3305d60
|
|
@ -189,7 +189,6 @@ const Meeting: React.FC = () => {
|
||||||
channelId: state.channelId,
|
channelId: state.channelId,
|
||||||
uid: userInfo.uid,
|
uid: userInfo.uid,
|
||||||
token: state.token,
|
token: state.token,
|
||||||
roleId: userInfo.roleId,
|
|
||||||
})
|
})
|
||||||
storage.setItem('noViewChatList', 0)
|
storage.setItem('noViewChatList', 0)
|
||||||
window.addEventListener('customStorageChange', handleCustomStorageChange);
|
window.addEventListener('customStorageChange', handleCustomStorageChange);
|
||||||
|
|
@ -688,15 +687,15 @@ const Meeting: React.FC = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取房间用户
|
// 获取房间用户
|
||||||
const getRoomUser = async (callback?: Function): Promise<void> => {
|
const getRoomUser = async (): Promise<void> => {
|
||||||
GetRoomUser(state.channelId).then(res => {
|
GetRoomUser(state.channelId).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
res.data.forEach((item: any) => {
|
res.data.forEach((item: any) => {
|
||||||
item.isShow = true;
|
item.isShow = true;
|
||||||
})
|
})
|
||||||
setRoomUserList(res.data)
|
setRoomUserList(res.data)
|
||||||
callback && callback(res.data)
|
|
||||||
changeAgoraDevice()
|
changeAgoraDevice()
|
||||||
|
agora.updateChannelMediaOptions(getUserRoomInfo(res.data) ? true : false)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -804,8 +803,9 @@ const Meeting: React.FC = () => {
|
||||||
// speakerModeModalRef.current.changeSpeakerMode()
|
// speakerModeModalRef.current.changeSpeakerMode()
|
||||||
// }
|
// }
|
||||||
// 获取当前用户在房间的角色信息
|
// 获取当前用户在房间的角色信息
|
||||||
const getUserRoomInfo = (): any => {
|
const getUserRoomInfo = (list?: any): any => {
|
||||||
let userItem = roomUserList.find((item: any) => item.uid === user.uid)
|
const data = list ? list : roomUserList
|
||||||
|
let userItem = data.find((item: any) => item.uid === user.uid)
|
||||||
if (userItem && (userItem.roleId === '1' || userItem.isRoomManager)) {
|
if (userItem && (userItem.roleId === '1' || userItem.isRoomManager)) {
|
||||||
return userItem
|
return userItem
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@ const option: any = {
|
||||||
token: '',
|
token: '',
|
||||||
channelId: '',
|
channelId: '',
|
||||||
uid: '',
|
uid: '',
|
||||||
roleId: ''
|
|
||||||
}
|
}
|
||||||
let rtcEngine: any = '';
|
let rtcEngine: any = '';
|
||||||
|
|
||||||
|
|
@ -189,7 +188,6 @@ const agora = {
|
||||||
joinChannel: async () => {
|
joinChannel: async () => {
|
||||||
await rtcEngine.enableAudioVolumeIndication(100, 1, true)
|
await rtcEngine.enableAudioVolumeIndication(100, 1, true)
|
||||||
await rtcEngine.joinChannel(option.token, option.channelId, option.uid);
|
await rtcEngine.joinChannel(option.token, option.channelId, option.uid);
|
||||||
await agora.updateChannelMediaOptions(option.roleId === '1' ? true : false)
|
|
||||||
},
|
},
|
||||||
// 更新频道配置
|
// 更新频道配置
|
||||||
updateChannelMediaOptions: async (bool: boolean) => {
|
updateChannelMediaOptions: async (bool: boolean) => {
|
||||||
|
|
@ -248,7 +246,6 @@ const agora = {
|
||||||
option.token = data.token;
|
option.token = data.token;
|
||||||
option.channelId = data.channelId;
|
option.channelId = data.channelId;
|
||||||
option.uid = Number(data.uid);
|
option.uid = Number(data.uid);
|
||||||
option.roleId = data.roleId;
|
|
||||||
await agora.joinChannel()
|
await agora.joinChannel()
|
||||||
},
|
},
|
||||||
// 桌面捕获音频和视频的媒体源的信息
|
// 桌面捕获音频和视频的媒体源的信息
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue