|
|
@@ -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 |