Browse Source

change camera

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

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

@@ -61,12 +61,12 @@ export default defineComponent({
const index = data.deviceList.findIndex((item) => item.deviceId === data.activeDeviceId)
if (data.deviceList.length === 1) {
return
} else if (index === data.deviceList.length - 1) {
data.activeDeviceId = data.deviceList[index - 1].deviceId
} else if (index === 0) {
data.activeDeviceId = data.deviceList[1].deviceId
emit('update:value', data.activeDeviceId)
emit('switch', { type: props.deviceType, deviceId: data.activeDeviceId })
} else {
data.activeDeviceId = data.deviceList[index + 1].deviceId
data.activeDeviceId = data.deviceList[0].deviceId
emit('update:value', data.activeDeviceId)
emit('switch', { type: props.deviceType, deviceId: data.activeDeviceId })
}

+ 3
- 1
src/views/home/index.vue View File

@@ -460,7 +460,9 @@ export default {
}

const handelCameraReverse = () => {
cameraRef.value.handleReverse()
if (!status.isMutedVideo) {
cameraRef.value.handleReverse()
}
}

onMounted(() => {

Loading…
Cancel
Save