浏览代码

change camera

master
zhangtao 1年前
父节点
当前提交
29e1ccad73
共有 2 个文件被更改,包括 6 次插入4 次删除
  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 查看文件

@@ -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 查看文件

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

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

onMounted(() => {

正在加载...
取消
保存