minimalistic_scanner / select_back_camera.js
Glainez's picture
Update select_back_camera.js
67ad67b verified
raw
history blame
460 Bytes
async function access_webcam_modified(): Promise<void> {
try {
const constraints = {
video: { facingMode: "environment" }, // Request the back camera
audio: include_audio
};
const stream = await navigator.mediaDevices.getUserMedia(constraints);
video_source.srcObject = stream;
video_source.play();
// Other setup code as needed
} catch (err) {
// Error handling
}
}