yangjie #49

Merged
yangqiang merged 71 commits from yangjie into master 2025-03-10 14:21:26 +08:00
1 changed files with 21 additions and 18 deletions
Showing only changes of commit 4121283ef1 - Show all commits

View File

@ -1003,7 +1003,7 @@ const Meeting: React.FC = () => {
break; break;
// 共享人取消共享屏幕 // 共享人取消共享屏幕
case 'StopedSharedScreen': case 'StopedSharedScreen':
getShowUser() setVideoUser()
break; break;
} }
}) })
@ -1726,26 +1726,29 @@ const Meeting: React.FC = () => {
}, 500); }, 500);
} }
// 全员观看 // 全员观看
const getShowUser = () => { const getShowUser = async (): Promise<void> => {
if (location.href.indexOf('/meeting') !== -1) { if (location.href.indexOf('/meeting') !== -1) {
setRoomUserList((newChatList: any) => { await GetShowUser(state.channelId).then(async (res) => {
setActiveSpeaker(res => { if (res.code === 200 && res.data) {
let item = newChatList.find((item: any) => item.uid === res) renderVideo(res.data)
if (item && item.isRoom && item.isAdmin) { }
renderVideo(res)
} else {
GetShowUser(state.channelId).then((req) => {
if (req.code === 200 && req.data) {
renderVideo(req.data)
}
})
}
return res
})
return newChatList
}) })
} }
} }
const setVideoUser = () => {
setRoomUserList((newChatList: any) => {
setActiveSpeaker(res => {
let item = newChatList.find((item: any) => item.uid === res)
if (item && item.isRoom && item.isAdmin) {
renderVideo(res)
} else {
getShowUser()
}
return res
})
return newChatList
})
}
// 加入房间时间 // 加入房间时间
const changeCurrentSeconds = (): string => { const changeCurrentSeconds = (): string => {
const duration = dayjs.duration(currentSeconds, 'seconds'); const duration = dayjs.duration(currentSeconds, 'seconds');
@ -2201,7 +2204,7 @@ const Meeting: React.FC = () => {
enableCamera: !storeDevice[0][1].active, enableCamera: !storeDevice[0][1].active,
isRoomManager: userItem ? userItem.isRoomManager : false, isRoomManager: userItem ? userItem.isRoomManager : false,
}) })
await getShowUser() setVideoUser()
if (userItem.isRoomManager) { if (userItem.isRoomManager) {
await postOpenMicr(!storeDevice[0][0].active, userInfo.uid) await postOpenMicr(!storeDevice[0][0].active, userInfo.uid)
await postOpenCamera(!storeDevice[0][1].active, userInfo.uid) await postOpenCamera(!storeDevice[0][1].active, userInfo.uid)