yangjie #28

Merged
yangqiang merged 32 commits from yangjie into master 2024-10-29 15:15:48 +08:00
1 changed files with 7 additions and 3 deletions
Showing only changes of commit 4232afef8a - Show all commits

View File

@ -314,13 +314,17 @@ const VideoComponents = () => {
placeholder={videoDeviceManager.list.length ? '请选择设备' : '未检测到摄像头'} placeholder={videoDeviceManager.list.length ? '请选择设备' : '未检测到摄像头'}
options={videoDeviceManager.list} style={{ flexGrow: 1, marginRight: '10px' }} options={videoDeviceManager.list} style={{ flexGrow: 1, marginRight: '10px' }}
value={videoDeviceManager.item} onChange={async (e) => { value={videoDeviceManager.item} onChange={async (e) => {
setting.videoDeviceId = e;
storage.setItem('setting', JSON.stringify(setting))
setVideoDeviceManager({ setVideoDeviceManager({
...videoDeviceManager, ...videoDeviceManager,
item: e item: e
}) })
agora.setVideoDeviceManager(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))
}} /> }} />
</div> </div>
@ -347,7 +351,7 @@ const VideoComponents = () => {
sourceIndex: '' sourceIndex: ''
}) })
}}> }}>
<input type="color" name="" id="color-select" onBlur={(e) => { <input type="color" name="" id="color-select" onChange={(e) => {
let hexInt = parseInt('0x' + e.target.value.split('#')[1], 16) let hexInt = parseInt('0x' + e.target.value.split('#')[1], 16)
setting.virtualBackground.color = hexInt setting.virtualBackground.color = hexInt
storage.setItem('setting', JSON.stringify(setting)) storage.setItem('setting', JSON.stringify(setting))