Comments (4)
Thanks for the research, will address this issue in the next release!
from ngx-scanner.
Thx for your fast response. I had a look at the commit and tested it locally. It's not solving the problem I mentioned.
The problem I'm referring to happens in the BrowserCodeReaderExt class. I will try to describe my use case a little bit in more detail:
- I'm adding the component and starting the camera (by setting the start input to true)
- As soon as I'm getting a response from the scan I'm stopping the camera (again by changing the start input to false - I even tried to call the stop method directly)
- the camera is stopped correctly (BrowserCodeReaderExt stop() is called)
- the stream is closed
- but now the callbackFn of the BrowserCodeReaderExt decode function returns a value and the check is done if the scan should only be done once
- if false (and it is false all the time) a new timeout is set and the decode is called again which leads to the mentioned error
A solution might be to not only check if the decode should be done once but also to check if the stream is still set:
if (!once && undefined !== this.stream) {
setTimeout(function () { return _this.decodeWithDelay(callbackFn); }, this.timeBetweenScansMillis);
}
I have created a pull request (my first one on github) - so if you can have a look or give me feedback, I would appreciate it.
from ngx-scanner.
Thanks for the detailed analysis and the PR! Looks good to me, I merged it. Thanks! BTW: my first angular component and also my first active project on github as well 😉
from ngx-scanner.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
from ngx-scanner.
Related Issues (20)
- When running ng serve shows the following error: HOT 5
- Read barcode numbers (not scan) HOT 3
- Auto focus/zoom / High Resolution does not work
- How to select the correct camera with autofocus? HOT 2
- noposter error again! HOT 2
- Need to touch the screen to see the camera
- have multiple webcam still get Cameras not found.
- Poor sharpness on iPhone Pro HOT 1
- Property '"autofocusEnabled"' is incompatible with index signature. HOT 2
- Cannot Scan code 93 and Codabar barcodes. No errors in the console as well
- cannot scan UPC_E barcodes
- Cannot read properties of undefined (reading stop)
- [Firefox-android] Permission issue HOT 1
- Please support Angular 17 HOT 1
- Cordova Android app
- Area of intreset feature
- Windows 11, camera shows screen stream instead
- Error reading QR code in Chrome
- when you open a scanner multiple times the CPU usage gets to 100% HOT 3
- Dependency bug
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-scanner.