From 9c19b41e2e7b51104a5a7a5a06d846f1f4660ff1 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Mon, 28 Oct 2024 15:34:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/StupWizard/index.tsx | 42 ++++++++++++++++------------- src/page/Meeting/index.tsx | 5 +++- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/src/components/StupWizard/index.tsx b/src/components/StupWizard/index.tsx index 9e09414..eeadfae 100644 --- a/src/components/StupWizard/index.tsx +++ b/src/components/StupWizard/index.tsx @@ -6,12 +6,14 @@ import { agora } from '@/utils/package/agora' import { CloseOutlined, LoadingOutlined, QuestionCircleOutlined } from '@ant-design/icons'; import { storage } from '@/utils'; import path from 'path'; - +import { role } from '@/config/role'; +let meetingUserInfo = '' as any; const fs = require('fs').promises; const { exec } = require('child_process'); const StupWizard = forwardRef((_props: any, ref: any) => { useImperativeHandle(ref, () => ({ - changeModal: (index: number = 0) => { + changeModal: (index: number = 0, data: any) => { + meetingUserInfo = data; if (location.hash.indexOf('/meeting') === -1) { agora.init() } @@ -675,22 +677,26 @@ const AudioComponents = () => { }) agora.setRecordingDevice(e) }} />; - {audioDeviceManager.ecordingActive ?
{ - agora.stopRecordingDeviceTest() - setAudioDeviceManager({ - ...audioDeviceManager, - playBackActive: false, - ecordingActive: false, - }) - }}>结束
:
{ - agora.stopPlaybackDeviceTest() - agora.startRecordingDeviceTest(100) - setAudioDeviceManager({ - ...audioDeviceManager, - playBackActive: false, - ecordingActive: true, - }) - }}>测试
} + {(meetingUserInfo && + (role.ID.includes(meetingUserInfo.roleId) || meetingUserInfo.isRoomManager) && + meetingUserInfo.enableMicr) || + location.hash.indexOf('/meeting') === -1 + ? audioDeviceManager.ecordingActive ?
{ + agora.stopRecordingDeviceTest() + setAudioDeviceManager({ + ...audioDeviceManager, + playBackActive: false, + ecordingActive: false, + }) + }}>结束
:
{ + agora.stopPlaybackDeviceTest() + agora.startRecordingDeviceTest(100) + setAudioDeviceManager({ + ...audioDeviceManager, + playBackActive: false, + ecordingActive: true, + }) + }}>测试
: null} {audioDeviceManager.ecordingActive ?
diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 9b97a7b..d422732 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -1426,7 +1426,10 @@ const Meeting: React.FC = () => { }) break; case '设置': - stupWizardRef.current.changeModal() + await getUserRoomInfo().then(async (res) => { + stupWizardRef.current.changeModal(0, res) + }) + break; case '邀请人员': await getUserRoomInfo().then(async (res) => {