GithubHelp home page GithubHelp logo

Comments (13)

palat-inc avatar palat-inc commented on August 19, 2024 2

The bug is reproduced. QrScanner component doesn't present in DOM, but camera is still working. tracker={false} doesn't affect anything.

from react-qr-scanner.

yoonh12 avatar yoonh12 commented on August 19, 2024 1

I'm not able to replicate this issue in Chrome or Safari. Could you provide an example with the issue?

I took a video and uploaded it on YouTube. Here's the link: https://www.youtube.com/watch?v=D9boAG1DInY
(you should look at the webcam LED status on the laptop. It doesn't turn off even after I go back. And the QrScanner is actually working at that moment.)

from react-qr-scanner.

sojib-lowp avatar sojib-lowp commented on August 19, 2024 1

I am getting this console error on unmount of QRScanner container component.

DOMException: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The source width is 0.
    at e2.makeBufferFromCanvasImageData (http://192.168.68.110:3000/node_modules/.vite/deps/@yudiel_react-qr-scanner.js?v=687bf47f:1354:34)
    at new e2 (http://192.168.68.110:3000/node_modules/.vite/deps/@yudiel_react-qr-scanner.js?v=687bf47f:1351:72)
    at t2.createBinaryBitmap (http://192.168.68.110:3000/node_modules/.vite/deps/@yudiel_react-qr-scanner.js?v=687bf47f:1877:46)
    at t2.decode (http://192.168.68.110:3000/node_modules/.vite/deps/@yudiel_react-qr-scanner.js?v=687bf47f:1873:19)
    at n2 (http://192.168.68.110:3000/node_modules/.vite/deps/@yudiel_react-qr-scanner.js?v=687bf47f:1865:23)

Just before this error I also get some warnings like this:

BrowserCodeReader.js:527 It was not possible to play the video.

and

BrowserCodeReader.js:515 Trying to play video that is already playing.

from react-qr-scanner.

yudielcurbelo avatar yudielcurbelo commented on August 19, 2024

Could you provide a code sandbox with the issue on hand?

After QrScanner is unmounted it will not exist anymore in the dom.

from react-qr-scanner.

Rehankhalil462 avatar Rehankhalil462 commented on August 19, 2024

By providing tracker={false} property to the QRScanner component, it solved the problem. Thanks for your fast reply.

from react-qr-scanner.

yoonh12 avatar yoonh12 commented on August 19, 2024

I'm having the same problem. But in my case, if I try to go back in the browser before the QrScanner component loads the video (or perhaps the camera device) completely, the camera device still works. So, I need to refresh the entire website to turn off it. (Interestingly, it works well in FireFox)

from react-qr-scanner.

Rehankhalil462 avatar Rehankhalil462 commented on August 19, 2024

@yoonh12 yes. right. It keeps on scanning under the hood unless we refresh the browser or unmount the component. Or after successful scan, you can turn the camera off by just providing tracker={false} property in the QRScanner component.

from react-qr-scanner.

yoonh12 avatar yoonh12 commented on August 19, 2024

@yoonh12 yes. right. It keeps on scanning under the hood unless we refresh the browser or unmount the component. Or after successful scan, you can turn the camera off by just providing tracker={false} property in the QRScanner component.

I've already gave that prop but it didn't help.

from react-qr-scanner.

yudielcurbelo avatar yudielcurbelo commented on August 19, 2024

I'm not able to replicate this issue in Chrome or Safari. Could you provide an example with the issue?

from react-qr-scanner.

yoonh12 avatar yoonh12 commented on August 19, 2024

The bug is reproduced. QrScanner component doesn't present in DOM, but camera is still working. tracker={false} doesn't affect anything.

Yes. I really want to fix this bug. but I don't know how :(

from react-qr-scanner.

raghupviyer avatar raghupviyer commented on August 19, 2024

Can you add a button for start and stop scanning or give us an api to implement it, to start the camera and stop it whenever we require it ... like in html5-qrcode, that feature could solve the issue

edit: oh sorry, tracker is the prop to handle that ... thanks

from react-qr-scanner.

mohamedamara1 avatar mohamedamara1 commented on August 19, 2024

I am getting this console error on unmount of QRScanner container component.

DOMException: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The source width is 0.
    at e2.makeBufferFromCanvasImageData (http://192.168.68.110:3000/node_modules/.vite/deps/@yudiel_react-qr-scanner.js?v=687bf47f:1354:34)
    at new e2 (http://192.168.68.110:3000/node_modules/.vite/deps/@yudiel_react-qr-scanner.js?v=687bf47f:1351:72)
    at t2.createBinaryBitmap (http://192.168.68.110:3000/node_modules/.vite/deps/@yudiel_react-qr-scanner.js?v=687bf47f:1877:46)
    at t2.decode (http://192.168.68.110:3000/node_modules/.vite/deps/@yudiel_react-qr-scanner.js?v=687bf47f:1873:19)
    at n2 (http://192.168.68.110:3000/node_modules/.vite/deps/@yudiel_react-qr-scanner.js?v=687bf47f:1865:23)

Just before this error I also get some warnings like this:

BrowserCodeReader.js:527 It was not possible to play the video.

and

BrowserCodeReader.js:515 Trying to play video that is already playing.

I'm getting this too BrowserCodeReader.js:515 Trying to play video that is already playing. after trying to turn back on the camera after turning it off with tracker={false}, which means it was already on

from react-qr-scanner.

yudielcurbelo avatar yudielcurbelo commented on August 19, 2024

Could you try it using localhost or https. By your error I see that you are using http.

from react-qr-scanner.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.