Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

118
Views
Select back camera on html5-qrcode.min.js

I use this qr code scanner: https://github.com/mebjas/html5-qrcode

I use this code to scan qr code:

         function onScanSuccess(decodedText, decodedResult) {
  // handle the scanned code as you like, for example:
  document.getElementById('text').value = decodedText;
  console.log(`Code matched = ${decodedText}`, decodedResult);
}

function onScanFailure(error) {
  // handle scan failure, usually better to ignore and keep scanning.
  // for example:
  console.warn(`Code scan error = ${error}`);
}

let html5QrcodeScanner = new Html5QrcodeScanner(
    "reader", { fps: 10, qrbox: 250 }, /* verbose= */ false);
html5QrcodeScanner.render(onScanSuccess, onScanFailure);

It is possible to set default camera to back smartfone camera. I want to run scanner with setted back camera on startup. Thanks, for some help.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I accomplish it using this bit of code when I launch the scanner:

facingMode: { exact: "environment"}

Maybe this will help point you in the right direction. Below is the way the setting is used when I launch the scanner:

    /** load scanner using back camera **/
    html5QrCode.start({ facingMode: { exact: "environment"} }, config, qrCodeSuccessCallback);
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!