BastiaanJansen/simple-vue-camera

changeCamera not working when using constraints

rttmax opened this issue · 0 comments

rttmax commented

simple-vue-camera.umd.js:198 Uncaught (in promise) TypeError: Cannot set properties of undefined (setting 'exact')
at simple-vue-camera.umd.js:198:56

When I add constraints to the camera component via prop, I can no longer switch between cameras.

<camera
    ref="camera"
    @loading="logEvent('loading')"
    @started="logEvent('started')"
    @error="(error) => logEvent('error: ' + error)"
    :constraints="{ video: { width: 500, height: 500 } }"
>
</camera>

It can be fixed by adding deviceId : {} to the constraints:
:constraints="{ video: { width: 500, height: 500, deviceId : {} }}"

I don't see the reason why deviceId should be part of the contrainst. But maybe I'm missing something