This commit is contained in:
parent
8ef5988cea
commit
69c88ba6d9
|
|
@ -97,13 +97,16 @@ const Index: React.FC = () => {
|
|||
style={{
|
||||
cursor: 'pointer',
|
||||
}}
|
||||
onClick={() => getRoomList()}
|
||||
onClick={() => {
|
||||
message.success('刷新成功')
|
||||
getRoomList()
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
{list.data.length ? <div className={styles.indexContentList}>
|
||||
{list.data.length ? <div className={`drag ${styles.indexContentList}`}>
|
||||
{list.data.map((item: any, index: number) => {
|
||||
return (
|
||||
<div className={`${styles.indexContentListItem} drag`} key={index}>
|
||||
<div className={`${styles.indexContentListItem}`} key={index}>
|
||||
<div>
|
||||
<div>{item.roomName}</div>
|
||||
<div>
|
||||
|
|
|
|||
|
|
@ -265,12 +265,8 @@ const Meeting: React.FC = () => {
|
|||
break;
|
||||
// 扩展操作
|
||||
case 'Operation':
|
||||
// 1:全员退出会议
|
||||
// 4:屏幕共享
|
||||
switch (item.type) {
|
||||
case 1:
|
||||
leaveChannel()
|
||||
break;
|
||||
case 4:
|
||||
setIsShare((res: any) => {
|
||||
if (userInfo.screenShareId === String(res)) {
|
||||
|
|
@ -284,8 +280,12 @@ const Meeting: React.FC = () => {
|
|||
}
|
||||
break;
|
||||
// 全员离开房间
|
||||
case 'AllLeave':
|
||||
leaveChannel(false)
|
||||
break;
|
||||
// 踢出房间
|
||||
case 'ForceExitRoom':
|
||||
leaveChannel()
|
||||
console.log(item);
|
||||
break;
|
||||
// 更新视图模式
|
||||
case 'RefreshView':
|
||||
|
|
@ -301,11 +301,7 @@ const Meeting: React.FC = () => {
|
|||
break;
|
||||
// 用户退出频道回调
|
||||
case 'UserLeave':
|
||||
if (item.uid === userInfo.uid) {
|
||||
leaveChannel()
|
||||
} else {
|
||||
setAllUserListData('UserLeave', item)
|
||||
}
|
||||
setAllUserListData('UserLeave', item)
|
||||
break;
|
||||
// 所有用户开闭麦
|
||||
case 'OperAllMicr':
|
||||
|
|
@ -630,9 +626,9 @@ const Meeting: React.FC = () => {
|
|||
setMediaStream('')
|
||||
}
|
||||
// 退出房间
|
||||
const leaveChannel = async (bool?: boolean): Promise<void> => {
|
||||
const leaveChannel = async (bool: boolean = true): Promise<void> => {
|
||||
await stopRecorderMedia()
|
||||
if (!bool) {
|
||||
if (bool) {
|
||||
await getLeave()
|
||||
}
|
||||
agora.leaveChannel()
|
||||
|
|
@ -1213,11 +1209,7 @@ const Meeting: React.FC = () => {
|
|||
title="提示"
|
||||
description={`结束会议后,所有人将退出,是否结束?`}
|
||||
onConfirm={async () => {
|
||||
await onInvoke('sendOper', {
|
||||
roomNum: state.channelId,
|
||||
type: 1,
|
||||
})
|
||||
leaveChannel(true)
|
||||
|
||||
}}
|
||||
onCancel={() => {
|
||||
|
||||
|
|
|
|||
|
|
@ -70,12 +70,18 @@ export const onSignalr = (callBack: Function) => {
|
|||
type
|
||||
})
|
||||
});
|
||||
// 全员离开房间
|
||||
// 踢出房间
|
||||
connection.on("ForceExitRoom", () => {
|
||||
callBack({
|
||||
key: 'ForceExitRoom',
|
||||
})
|
||||
});
|
||||
// 全员离开房间
|
||||
connection.on("AllLeave", () => {
|
||||
callBack({
|
||||
key: 'AllLeave',
|
||||
})
|
||||
});
|
||||
// 全员看他
|
||||
connection.on("ShowUser", () => {
|
||||
callBack({
|
||||
|
|
@ -139,6 +145,7 @@ export const offSignalr = () => {
|
|||
connection.off('ReceiveMessage');
|
||||
connection.off('Operation');
|
||||
connection.off('ForceExitRoom');
|
||||
connection.off('AllLeave');
|
||||
connection.off('ShowUser');
|
||||
connection.off('RefreshView');
|
||||
connection.off('UserJoined');
|
||||
|
|
@ -155,7 +162,6 @@ export const onInvoke = async (str: string, data: any) => {
|
|||
await connection.invoke(str, data.roomNum, data.msg)
|
||||
break;
|
||||
case 'sendOper':
|
||||
// 1:全员退出会议
|
||||
// 4:屏幕共享
|
||||
await connection.invoke(str, data.roomNum, data.type)
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in New Issue