yangjie #49
|
|
@ -218,6 +218,7 @@ const Meeting: React.FC = () => {
|
||||||
});
|
});
|
||||||
const [isVideoFullScreen, setIsVideoFullScreen] = useState<boolean>(false)
|
const [isVideoFullScreen, setIsVideoFullScreen] = useState<boolean>(false)
|
||||||
const [observer, setObserver] = useState<IntersectionObserver>()
|
const [observer, setObserver] = useState<IntersectionObserver>()
|
||||||
|
const [_activeSpeaker, setActiveSpeaker] = useState('')
|
||||||
let userInfo = JSON.parse(storage.getItem('user') as string)
|
let userInfo = JSON.parse(storage.getItem('user') as string)
|
||||||
const msgTips = '您不是管理员或发言人,无法开启此功能!'
|
const msgTips = '您不是管理员或发言人,无法开启此功能!'
|
||||||
const channel = new BroadcastChannel('meeting_channel');
|
const channel = new BroadcastChannel('meeting_channel');
|
||||||
|
|
@ -275,7 +276,7 @@ const Meeting: React.FC = () => {
|
||||||
case 'shareScreenWindowClose':
|
case 'shareScreenWindowClose':
|
||||||
setCurrentSeconds(shareScreenWindowClose)
|
setCurrentSeconds(shareScreenWindowClose)
|
||||||
await stopScreenCapture()
|
await stopScreenCapture()
|
||||||
await allUserLook(userInfo.uid, userInfo.userName)
|
await allUserLook(userInfo.uid, userInfo.userName, true)
|
||||||
break;
|
break;
|
||||||
case 'shareScreenWindowfooterListsTitle':
|
case 'shareScreenWindowfooterListsTitle':
|
||||||
switch (shareScreenWindowfooterListsTitle) {
|
switch (shareScreenWindowfooterListsTitle) {
|
||||||
|
|
@ -1417,7 +1418,7 @@ const Meeting: React.FC = () => {
|
||||||
if (bool) {
|
if (bool) {
|
||||||
stopScreenCapture()
|
stopScreenCapture()
|
||||||
setSharedScreenItem('')
|
setSharedScreenItem('')
|
||||||
allUserLook(userInfo.uid, userInfo.userName)
|
allUserLook(userInfo.uid, userInfo.userName, true)
|
||||||
}
|
}
|
||||||
return bool
|
return bool
|
||||||
})
|
})
|
||||||
|
|
@ -1463,6 +1464,9 @@ const Meeting: React.FC = () => {
|
||||||
setAudioStatus(newState)
|
setAudioStatus(newState)
|
||||||
},
|
},
|
||||||
onActiveSpeaker: (_connection: RtcConnection, uid: number) => {
|
onActiveSpeaker: (_connection: RtcConnection, uid: number) => {
|
||||||
|
if (String(uid).length !== 9) {
|
||||||
|
setActiveSpeaker(String(uid))
|
||||||
|
}
|
||||||
setIsShare((res: any) => {
|
setIsShare((res: any) => {
|
||||||
if (!res && String(uid).length !== 9) {
|
if (!res && String(uid).length !== 9) {
|
||||||
renderVideo(String(uid))
|
renderVideo(String(uid))
|
||||||
|
|
@ -1811,7 +1815,7 @@ const Meeting: React.FC = () => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
if (row.title === '停止共享') {
|
if (row.title === '停止共享') {
|
||||||
await allUserLook(userInfo.uid, userInfo.userName)
|
await allUserLook(userInfo.uid, userInfo.userName, true)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case '静音':
|
case '静音':
|
||||||
|
|
@ -2078,9 +2082,24 @@ const Meeting: React.FC = () => {
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
// 设置全员看谁
|
// 设置全员看谁
|
||||||
const allUserLook = async (uid: string, name: string): Promise<void> => {
|
const allUserLook = async (uid: string, name: string, bool?: boolean): Promise<void> => {
|
||||||
|
if (bool) {
|
||||||
|
setRoomUserList((newChatList: any) => {
|
||||||
|
setActiveSpeaker(res => {
|
||||||
|
let item = newChatList.find((item: any) => item.uid === res)
|
||||||
|
if (item && item.isRoom && item.isAdmin) {
|
||||||
|
PostShowUser(state.channelId, item.uid, name)
|
||||||
|
} else {
|
||||||
|
PostShowUser(state.channelId, uid, name)
|
||||||
|
}
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
return newChatList
|
||||||
|
})
|
||||||
|
} else {
|
||||||
await PostShowUser(state.channelId, uid, name)
|
await PostShowUser(state.channelId, uid, name)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// 设置发言人
|
// 设置发言人
|
||||||
const postRoomManager = async (data: any): Promise<void> => {
|
const postRoomManager = async (data: any): Promise<void> => {
|
||||||
if (isAdmin >= 20) {
|
if (isAdmin >= 20) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue