From 4232afef8a789e74e17bf054b3c98001df86bc4c Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Wed, 23 Oct 2024 15:42:19 +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 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/StupWizard/index.tsx b/src/components/StupWizard/index.tsx index c476ef0..5d3edf0 100644 --- a/src/components/StupWizard/index.tsx +++ b/src/components/StupWizard/index.tsx @@ -314,13 +314,17 @@ const VideoComponents = () => { placeholder={videoDeviceManager.list.length ? '请选择设备' : '未检测到摄像头'} options={videoDeviceManager.list} style={{ flexGrow: 1, marginRight: '10px' }} value={videoDeviceManager.item} onChange={async (e) => { - setting.videoDeviceId = e; - storage.setItem('setting', JSON.stringify(setting)) setVideoDeviceManager({ ...videoDeviceManager, item: e }) agora.setVideoDeviceManager(e) + if (!setting.videoDeviceId) { + const userInfo = JSON.parse(storage.getItem('user') as string) + await agora.startPreview('videoPreview', Number(userInfo.screenShareId)) + } + setting.videoDeviceId = e; + storage.setItem('setting', JSON.stringify(setting)) }} /> @@ -347,7 +351,7 @@ const VideoComponents = () => { sourceIndex: '' }) }}> - { + { let hexInt = parseInt('0x' + e.target.value.split('#')[1], 16) setting.virtualBackground.color = hexInt storage.setItem('setting', JSON.stringify(setting))