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