try again if no rear camera

pull/32/head
Niko PLP 4 months ago
parent c0664250b4
commit bce4acd90f
  1. 4
      ng-app/src/routes/ScanQR.svelte

@ -58,14 +58,14 @@
// ); // );
try { try {
webScanner = new Html5Qrcode ("scanner-div"); webScanner = new Html5Qrcode ("scanner-div");
webScanner.start({ facingMode: { exact: "environment"} }, { fps: 10, qrbox: { width: 300, height: 300 }, formatsToSupport: [0] }, (decoded_text, decoded_result) => { await webScanner.start({ facingMode: { exact: "environment"} }, { fps: 10, qrbox: { width: 300, height: 300 }, formatsToSupport: [0] }, (decoded_text, decoded_result) => {
//console.log(decoded_result); //console.log(decoded_result);
// Handle scan result // Handle scan result
on_qr_scanned(decoded_text); on_qr_scanned(decoded_text);
}); });
} catch (e) { } catch (e) {
webScanner = new Html5Qrcode ("scanner-div"); webScanner = new Html5Qrcode ("scanner-div");
webScanner.start({ facingMode: "environment" }, { fps: 10, qrbox: { width: 300, height: 300 }, formatsToSupport: [0] }, (decoded_text, decoded_result) => { await webScanner.start({ facingMode: "environment" }, { fps: 10, qrbox: { width: 300, height: 300 }, formatsToSupport: [0] }, (decoded_text, decoded_result) => {
//console.log(decoded_result); //console.log(decoded_result);
// Handle scan result // Handle scan result
on_qr_scanned(decoded_text); on_qr_scanned(decoded_text);

Loading…
Cancel
Save