diff --git a/src/camera.js b/src/camera.js index 5403b3ca..5b394e2e 100644 --- a/src/camera.js +++ b/src/camera.js @@ -21,15 +21,12 @@ class Camera { let constraints = { audio: false, video: { - mandatory: { - sourceId: this.id, - minWidth: 600, - maxWidth: 800, - minAspectRatio: 1.6 - }, - optional: [] + deviceId: this.id ? { exact: this.id } : undefined, + facingMode: { ideal: "environment" }, + width: { min: 600, max: 800 }, + aspectRatio: { min: 1.6 } } - }; + }; this._stream = await Camera._wrapErrors(async () => { return await navigator.mediaDevices.getUserMedia(constraints);