ui: Select environment camera if possible
Apparently, Firefox/Android defaults to using the front camera, and does not provide any native UI for selecting a different one. We can request the back camera by indiciting that the "environment" camera is "ideal."bugfix/ci-buildah
parent
cdf50c159c
commit
2d7ff417fc
|
@ -57,7 +57,11 @@ async function startCamera() {
|
||||||
let stream: MediaStream;
|
let stream: MediaStream;
|
||||||
try {
|
try {
|
||||||
stream = await navigator.mediaDevices.getUserMedia({
|
stream = await navigator.mediaDevices.getUserMedia({
|
||||||
video: true,
|
video: {
|
||||||
|
facingMode: {
|
||||||
|
ideal: "environment",
|
||||||
|
},
|
||||||
|
},
|
||||||
audio: false,
|
audio: false,
|
||||||
});
|
});
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
|
|
Loading…
Reference in New Issue