change device
This commit is contained in:
parent
69356dd714
commit
ca616cfb08
|
|
@ -39,16 +39,16 @@ export default defineComponent({
|
||||||
const handleReverse = () => {
|
const handleReverse = () => {
|
||||||
const index = data.videoList.findIndex((item) => item.deviceId === data.activeDeviceId)
|
const index = data.videoList.findIndex((item) => item.deviceId === data.activeDeviceId)
|
||||||
const len = data.videoList.length
|
const len = data.videoList.length
|
||||||
if (len === 1) {
|
if (len <= 1) {
|
||||||
return
|
return
|
||||||
} else if (index === 0) {
|
} else if (index === 0) {
|
||||||
data.videoDeviceId = data.deviceList[len - 1].deviceId
|
data.videoDeviceId = data.videoList[len - 1].deviceId
|
||||||
emit('init', {
|
emit('init', {
|
||||||
cameraId: data.videoDeviceId,
|
cameraId: data.videoDeviceId,
|
||||||
microphoneId: data.audioDeviceId
|
microphoneId: data.audioDeviceId
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
data.videoDeviceId = data.deviceList[0].deviceId
|
data.videoDeviceId = data.videoList[0].deviceId
|
||||||
emit('init', {
|
emit('init', {
|
||||||
cameraId: data.videoDeviceId,
|
cameraId: data.videoDeviceId,
|
||||||
microphoneId: data.audioDeviceId
|
microphoneId: data.audioDeviceId
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue