全员退出会议
This commit is contained in:
parent
4f023da7d7
commit
1ef7b31bed
|
|
@ -173,6 +173,10 @@ const Meeting: React.FC = () => {
|
|||
case 'RefreshUserList':
|
||||
getRoomUser()
|
||||
break;
|
||||
case 'Operation':
|
||||
console.log('嘻嘻', item);
|
||||
leaveChannel()
|
||||
break;
|
||||
}
|
||||
})
|
||||
}, [])
|
||||
|
|
@ -262,7 +266,12 @@ const Meeting: React.FC = () => {
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 退出房间
|
||||
const leaveChannel = (): void => {
|
||||
agora.leaveChannel()
|
||||
agora.stopScreenCapture()
|
||||
navigate(-1)
|
||||
}
|
||||
// 分享屏幕
|
||||
const clickSharedScreen = async (): Promise<void> => {
|
||||
let data = sharedScreenList.find((item: any) => item.sourceId === sharedScreenItem.sourceId)
|
||||
|
|
@ -508,16 +517,14 @@ const Meeting: React.FC = () => {
|
|||
<Popover key={rowIndex}
|
||||
content={
|
||||
<div className='meetingContentFooterPopover'>
|
||||
<div onClick={() => {
|
||||
agora.leaveChannel()
|
||||
agora.stopScreenCapture()
|
||||
navigate(-1)
|
||||
<div onClick={async () => {
|
||||
await onInvoke('sendOper', {
|
||||
roomNum: state.channelId,
|
||||
type: 1,
|
||||
})
|
||||
leaveChannel()
|
||||
}}>全员结束会议</div>
|
||||
<div onClick={() => {
|
||||
agora.leaveChannel()
|
||||
agora.stopScreenCapture()
|
||||
navigate(-1)
|
||||
}}>仅自己离开</div>
|
||||
<div onClick={() => leaveChannel()}>仅自己离开</div>
|
||||
<div onClick={() => { setOpen(false) }}>取消</div>
|
||||
</div>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,10 +17,10 @@ export const startSignalr = () => {
|
|||
}
|
||||
|
||||
export const onSignalr = (callBack: Function) => {
|
||||
if (connection){
|
||||
if (connection) {
|
||||
connection.on("ReceiveMessage", (uid: string, userName: string, message: string) => {
|
||||
callBack({
|
||||
key:'ReceiveMessage',
|
||||
key: 'ReceiveMessage',
|
||||
uid, message, userName
|
||||
})
|
||||
});
|
||||
|
|
@ -29,6 +29,12 @@ export const onSignalr = (callBack: Function) => {
|
|||
key: 'RefreshUserList'
|
||||
})
|
||||
});
|
||||
connection.on("Operation", (type: number) => {
|
||||
callBack({
|
||||
key: 'Operation',
|
||||
type
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
export const onInvoke = async (str: string, data: any) => {
|
||||
|
|
@ -42,6 +48,11 @@ export const onInvoke = async (str: string, data: any) => {
|
|||
case 'sendChannelMsg':
|
||||
await connection.invoke(str, data.roomNum, data.msg)
|
||||
break;
|
||||
case 'sendOper':
|
||||
// 1:全员退出会议
|
||||
console.log(data);
|
||||
await connection.invoke(str, data.roomNum, data.type)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue