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))