|
|
|
@ -8,7 +8,7 @@ import { SearchOutlined, EllipsisOutlined, ExclamationCircleFilled, FullscreenEx
|
|
|
|
import { useLocation, useNavigate } from 'react-router-dom';
|
|
|
|
import { useLocation, useNavigate } from 'react-router-dom';
|
|
|
|
import { thumbImageBufferToBase64 } from '@/utils/package/base64'
|
|
|
|
import { thumbImageBufferToBase64 } from '@/utils/package/base64'
|
|
|
|
import { storage } from '@/utils';
|
|
|
|
import { storage } from '@/utils';
|
|
|
|
import { GetRoomUser, PostOpenMicr, PostOpenCamera, GetLeaveAll, PostRoomManager, DeleteRoomManager, GetRoomKickout, GetShowUser, PostShowUser, GetJoin, GetLeave, PostMuteAll, GetRoomUserItem, GetApplySpeak } from '@/api/Meeting';
|
|
|
|
import { GetRoomUser, PostOpenMicr, PostOpenCamera, GetLeaveAll, PostRoomManager, DeleteRoomManager, GetRoomKickout, GetShowUser, PostShowUser, PostMuteAll, GetRoomUserItem, GetApplySpeak } from '@/api/Meeting';
|
|
|
|
import ImageUrl from '@/utils/package/imageUrl'
|
|
|
|
import ImageUrl from '@/utils/package/imageUrl'
|
|
|
|
import { agora } from '@/utils/package/agora'
|
|
|
|
import { agora } from '@/utils/package/agora'
|
|
|
|
import { onInvoke, onSignalr, offSignalr, onStart } from '@/utils/package/signalr';
|
|
|
|
import { onInvoke, onSignalr, offSignalr, onStart } from '@/utils/package/signalr';
|
|
|
|
@ -24,7 +24,6 @@ import { role } from '@/config/role';
|
|
|
|
const { ipcRenderer } = require('electron');
|
|
|
|
const { ipcRenderer } = require('electron');
|
|
|
|
import * as path from 'path';
|
|
|
|
import * as path from 'path';
|
|
|
|
const { confirm } = Modal;
|
|
|
|
const { confirm } = Modal;
|
|
|
|
|
|
|
|
|
|
|
|
const { exec } = require('child_process');
|
|
|
|
const { exec } = require('child_process');
|
|
|
|
const fs = require('fs').promises;
|
|
|
|
const fs = require('fs').promises;
|
|
|
|
dayjs.extend(durationPlugin);
|
|
|
|
dayjs.extend(durationPlugin);
|
|
|
|
@ -642,12 +641,12 @@ const Meeting: React.FC = () => {
|
|
|
|
|
|
|
|
|
|
|
|
// 声网初始化
|
|
|
|
// 声网初始化
|
|
|
|
const agoraInit = async () => {
|
|
|
|
const agoraInit = async () => {
|
|
|
|
|
|
|
|
await getJoin(state.enableMicr, state.enableCamera)
|
|
|
|
await agora.init(true)
|
|
|
|
await agora.init(true)
|
|
|
|
agora.registerEventHandler({
|
|
|
|
agora.registerEventHandler({
|
|
|
|
onJoinChannelSuccess: async (info: any, _elapsed: any) => {
|
|
|
|
onJoinChannelSuccess: async (info: any, _elapsed: any) => {
|
|
|
|
if (info.channelId === state.channelId) {
|
|
|
|
if (info.channelId === state.channelId) {
|
|
|
|
if (String(info.localUid).length !== 9) {
|
|
|
|
if (String(info.localUid).length !== 9) {
|
|
|
|
await getJoin(state.enableMicr, state.enableCamera)
|
|
|
|
|
|
|
|
setTimeout(async () => {
|
|
|
|
setTimeout(async () => {
|
|
|
|
await agora.setupLocalVideo({
|
|
|
|
await agora.setupLocalVideo({
|
|
|
|
uid: Number(info.localUid),
|
|
|
|
uid: Number(info.localUid),
|
|
|
|
@ -866,7 +865,11 @@ const Meeting: React.FC = () => {
|
|
|
|
message.success('网络已恢复。')
|
|
|
|
message.success('网络已恢复。')
|
|
|
|
setTimeout(async () => {
|
|
|
|
setTimeout(async () => {
|
|
|
|
await onStart(async () => {
|
|
|
|
await onStart(async () => {
|
|
|
|
await getJoin(!footerList[0][0].active, !footerList[0][1].active)
|
|
|
|
await onInvoke('joinChannel', {
|
|
|
|
|
|
|
|
roomNum: state.channelId,
|
|
|
|
|
|
|
|
enableMicr: !footerList[0][0].active,
|
|
|
|
|
|
|
|
enableCamera: !footerList[0][1].active
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}, 1000)
|
|
|
|
}, 1000)
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
@ -1249,7 +1252,11 @@ const Meeting: React.FC = () => {
|
|
|
|
case 'reconnect':
|
|
|
|
case 'reconnect':
|
|
|
|
if (e.value == true) {
|
|
|
|
if (e.value == true) {
|
|
|
|
storage.setItem('reconnect', false)
|
|
|
|
storage.setItem('reconnect', false)
|
|
|
|
await getJoin(!footerList[0][0].active, !footerList[0][1].active)
|
|
|
|
await onInvoke('joinChannel', {
|
|
|
|
|
|
|
|
roomNum: state.channelId,
|
|
|
|
|
|
|
|
enableMicr: !footerList[0][0].active,
|
|
|
|
|
|
|
|
enableCamera: !footerList[0][1].active
|
|
|
|
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -1490,7 +1497,12 @@ const Meeting: React.FC = () => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 加入房间
|
|
|
|
// 加入房间
|
|
|
|
const getJoin = async (enableMicr: boolean, enableCamera: boolean): Promise<void> => {
|
|
|
|
const getJoin = async (enableMicr: boolean, enableCamera: boolean): Promise<void> => {
|
|
|
|
await GetJoin({
|
|
|
|
// await GetJoin({
|
|
|
|
|
|
|
|
// roomNum: state.channelId,
|
|
|
|
|
|
|
|
// enableMicr,
|
|
|
|
|
|
|
|
// enableCamera
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
await onInvoke('joinChannel', {
|
|
|
|
roomNum: state.channelId,
|
|
|
|
roomNum: state.channelId,
|
|
|
|
enableMicr,
|
|
|
|
enableMicr,
|
|
|
|
enableCamera
|
|
|
|
enableCamera
|
|
|
|
@ -1499,8 +1511,11 @@ const Meeting: React.FC = () => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 离开房间
|
|
|
|
// 离开房间
|
|
|
|
const getLeave = async (): Promise<void> => {
|
|
|
|
const getLeave = async (): Promise<void> => {
|
|
|
|
await GetLeave({
|
|
|
|
// await GetLeave({
|
|
|
|
roomNum: state.channelId,
|
|
|
|
// roomNum: state.channelId,
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
await onInvoke('levelChannel', {
|
|
|
|
|
|
|
|
roomNum: state.channelId
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 设置全员观看
|
|
|
|
// 设置全员观看
|
|
|
|
|