# Camera for QR scan not working

**URL:** https://forum.infinityfree.com/t/camera-for-qr-scan-not-working/112541
**Category:** Hosting Support
**Created:** [July 1, 2025, 6:52pm UTC](https://forum.infinityfree.com/t/camera-for-qr-scan-not-working/112541 "2025-07-01T18:52:08Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Jboxer](https://forum.infinityfree.com/letter_avatar/jboxer/32/5_5575768a8748004e209b776fc1b2916d.png) [@Jboxer](https://forum.infinityfree.com/u/Jboxer)
#### Post date: [July 1, 2025, 6:52pm UTC](https://forum.infinityfree.com/t/camera-for-qr-scan-not-working/112541/1 "2025-07-01T18:52:08Z")

</div>

Hi There,

The camera doesn’t seem to work and I’m not getting any error messages.  
I’m using the camera for qr scanning using the html5-qrcode library → [https://cdnjs.cloudflare.com/ajax/libs/html5-qrcode/2.3.4/html5-qrcode.min.js](https://cdnjs.cloudflare.com/ajax/libs/html5-qrcode/2.3.4/html5-qrcode.min.js)

This runs well in my local.

Thanks.

---

<div class="post-metadata">

### Author: ![Greenreader9](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/greenreader9/32/22847_2.png) [@Greenreader9](https://forum.infinityfree.com/u/Greenreader9)
#### Post date: [July 1, 2025, 6:56pm UTC](https://forum.infinityfree.com/t/camera-for-qr-scan-not-working/112541/2 "2025-07-01T18:56:55Z")

</div>

Please share your code/URL

---

<div class="post-metadata">

### Author: ![Jboxer](https://forum.infinityfree.com/letter_avatar/jboxer/32/5_5575768a8748004e209b776fc1b2916d.png) [@Jboxer](https://forum.infinityfree.com/u/Jboxer)
#### Post date: [July 1, 2025, 6:57pm UTC](https://forum.infinityfree.com/t/camera-for-qr-scan-not-working/112541/3 "2025-07-01T18:57:41Z")

</div>

Here’s the URL → [https://camc-qr.rf.gd/index.php](https://camc-qr.rf.gd/index.php)

---

<div class="post-metadata">

### Author: ![Greenreader9](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/greenreader9/32/22847_2.png) [@Greenreader9](https://forum.infinityfree.com/u/Greenreader9)
#### Post date: [July 1, 2025, 7:17pm UTC](https://forum.infinityfree.com/t/camera-for-qr-scan-not-working/112541/4 "2025-07-01T19:17:22Z")

</div>

I’m going to guess something is not setup correctly, since parts of the widget (`Request Camera Permissions` and `Scan an Image File` buttons) are missing.

Make sure you have installed the widget according to the docs:

> **[Getting started | ScanApp](https://scanapp.org/html5-qrcode-docs/docs/intro)**
>
> Let's discover html5-qrcode in less than 5 minutes.

Command line access is not supported here, so you’ll need to run commands on your machine and upload resulting files over FTP

---

<div class="post-metadata">

### Author: ![Jboxer](https://forum.infinityfree.com/letter_avatar/jboxer/32/5_5575768a8748004e209b776fc1b2916d.png) [@Jboxer](https://forum.infinityfree.com/u/Jboxer)
#### Post date: [July 1, 2025, 7:30pm UTC](https://forum.infinityfree.com/t/camera-for-qr-scan-not-working/112541/5 "2025-07-01T19:30:50Z")

</div>

I see. I’m not really sure what’s the issue. But here’s my code →

```auto
<!-- Scanner Lib -->
  <script src="https://cdnjs.cloudflare.com/ajax/libs/html5-qrcode/2.3.4/html5-qrcode.min.js"
        integrity="sha512-k/KAe4Yff9EUdYI5/IAHlwUswqeipP+Cp5qnrsUjTPCgl51La2/JhyyjNciztD7mWNKLSXci48m7cctATKfLlQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer"></script>

<script>
    const scanner = new Html5QrcodeScanner("reader", { qrbox: { width: 250, height: 250 }, fps: 10 });

    scanner.render(onScanSuccess, onScanError);

    function onScanSuccess(qrCodeMessage) {
      document.getElementById("result").innerHTML = `
        <h3>Scanned Code:</h3>
        <div class="container-fluid py-3">
          <div class="h-100 p-3 text-bg-light rounded-3">
            <h2>${qrCodeMessage}</h2>
          </div>
        </div>
      `;

      scanner.clear();
      document.getElementById("reader").remove();

      fetch("scanner-submit.php", {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
        },
        body: JSON.stringify({ qr_value: qrCodeMessage }),
      })
        .then(response => {
          if (!response.ok) throw new Error("Server error");
          return response.json();
        })
        .then(data => {
          document.getElementById("result").innerHTML += `
          <p class="text-success">${data.message}</p>
          <a href="scanner.php" class="btn btn-lg btn-light fw-bold ctm-btn">Scan Again</a>
        `;
        })
        .catch(error => {
          console.error("Error:", error);
          document.getElementById("result").innerHTML += `
          <p class="text-danger">Error saving QR to database.</p>
          <a href="scanner.php" class="btn btn-light">Try Again</a>
        `;
        });
    }

    function onScanError(err) {
      console.warn("Scan error:", err);
    }
  </script>

```

---

<div class="post-metadata">

### Author: ![Jboxer](https://forum.infinityfree.com/letter_avatar/jboxer/32/5_5575768a8748004e209b776fc1b2916d.png) [@Jboxer](https://forum.infinityfree.com/u/Jboxer)
#### Post date: [July 1, 2025, 7:32pm UTC](https://forum.infinityfree.com/t/camera-for-qr-scan-not-working/112541/6 "2025-07-01T19:32:44Z")

</div>

Here’s the code ni codepen.

[https://codepen.io/jeruinthebox/pen/PwqvPNG](https://codepen.io/jeruinthebox/pen/PwqvPNG)

---

<div class="post-metadata">

### Author: ![Admin](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/admin/32/36437_2.png) [@Admin](https://forum.infinityfree.com/u/Admin)
#### Post date: [July 2, 2025, 8:03am UTC](https://forum.infinityfree.com/t/camera-for-qr-scan-not-working/112541/7 "2025-07-02T08:03:01Z")

</div>

I have no idea why it doesn’t work for you.

But it should be noted that the scanner widget appears to be rendered completely by the browser. So there is no way for us to affect that from the server/hosting side. The code on the codepen and on your website appears to be identical, so I have no idea why it doesn’t work. There are no errors reported on your site at all.

When I run a little test script to get camera permission, it does work correctly.

So I’m guessing the issue you’re having has something to do with the internals of the QR code library you’re using. But I have no experience with that library, so I cannot really help you with that.

---

<div class="post-metadata">

### Author: ![Jboxer](https://forum.infinityfree.com/letter_avatar/jboxer/32/5_5575768a8748004e209b776fc1b2916d.png) [@Jboxer](https://forum.infinityfree.com/u/Jboxer)
#### Post date: [July 2, 2025, 5:38pm UTC](https://forum.infinityfree.com/t/camera-for-qr-scan-not-working/112541/8 "2025-07-02T17:38:52Z")

</div>

I see. Like you said, it might be because of the scanner library I’m using. I’ll try other library then like the scanapp.

Thanks!

---

<div class="post-metadata">

### Author: ![Jboxer](https://forum.infinityfree.com/letter_avatar/jboxer/32/5_5575768a8748004e209b776fc1b2916d.png) [@Jboxer](https://forum.infinityfree.com/u/Jboxer)
#### Post date: [July 2, 2025, 6:14pm UTC](https://forum.infinityfree.com/t/camera-for-qr-scan-not-working/112541/9 "2025-07-02T18:14:57Z")

</div>

Closing this topic. I just had the camera working already by using a different librabry(scanapp).

---

<div class="post-metadata">

### Author: ![system](https://infinityfree-forum-uploads.s3.dualstack.eu-central-1.amazonaws.com/original/3X/b/0/b024fd3fa88bae093c9576e55c2c94e33f890206.svg) [@system](https://forum.infinityfree.com/u/system)
#### Post date: [July 9, 2025, 6:15pm UTC](https://forum.infinityfree.com/t/camera-for-qr-scan-not-working/112541/10 "2025-07-09T18:15:52Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
