Browse Source

change device

master
zhangtao 2 years ago
parent
commit
ca616cfb08
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      src/views/home/components/Device.vue

+ 3
- 3
src/views/home/components/Device.vue View File

@@ -39,16 +39,16 @@ export default defineComponent({
const handleReverse = () => {
const index = data.videoList.findIndex((item) => item.deviceId === data.activeDeviceId)
const len = data.videoList.length
if (len === 1) {
if (len <= 1) {
return
} else if (index === 0) {
data.videoDeviceId = data.deviceList[len - 1].deviceId
data.videoDeviceId = data.videoList[len - 1].deviceId
emit('init', {
cameraId: data.videoDeviceId,
microphoneId: data.audioDeviceId
})
} else {
data.videoDeviceId = data.deviceList[0].deviceId
data.videoDeviceId = data.videoList[0].deviceId
emit('init', {
cameraId: data.videoDeviceId,
microphoneId: data.audioDeviceId

Loading…
Cancel
Save