This commit is contained in:
yj 2024-08-14 16:19:44 +08:00
parent 8e0bfa8ce8
commit 4d074cf28b
1 changed files with 2 additions and 2 deletions

View File

@ -155,7 +155,7 @@ const VideoComponents = () => {
const getVideoDeviceList = async (): Promise<void> => { const getVideoDeviceList = async (): Promise<void> => {
const userInfo = JSON.parse(storage.getItem('user') as string) const userInfo = JSON.parse(storage.getItem('user') as string)
agora.getVideoDeviceManager().then(async (res) => { agora.getVideoDeviceManager().then(async (res) => {
const { item, list } = res const { list } = res
setVideoDeviceManager({ setVideoDeviceManager({
list: list.map((row: any) => { list: list.map((row: any) => {
return { return {
@ -163,7 +163,7 @@ const VideoComponents = () => {
label: row.deviceName label: row.deviceName
} }
}), }),
item: setting.videoDeviceId ? setting.videoDeviceId : item || null, item: setting.videoDeviceId,
}) })
if (setting.videoDeviceId && list.length) { if (setting.videoDeviceId && list.length) {
await agora.setVideoDeviceManager(setting.videoDeviceId) await agora.setVideoDeviceManager(setting.videoDeviceId)