Comments (4)
html5-qrcode was never developed to be on angular framework. however you can easily create a PR to satisfy your wishes.
from html5-qrcode.
We have implemented this in Angular. Let me know if you still need help with this
from html5-qrcode.
from html5-qrcode.
Hope this helps, npm i html5-qrcode
in your angular project,
For your barcode component (giving you bits and pieces but let me know if that helps)
import { Html5Qrcode} from 'html5-qrcode';
qrResultString: string;
ngOnInit() {
const html5QrCode = new Html5Qrcode('qr-reader');
const config = {
fps: 10,
qrbox: 300,
showTorchButtonIfSupported: true,
rememberLastUsedCamera: true,
showZoomSliderIfSupported: true,
useBarCodeDetectorIfSupported: true,
defaultZoomValueIfSupported: 2};
const onScanSuccess = (decodedText, decodedResult) => {
if (!this.qrResultString) {
// handle the scanned code as you like, for example:
console.log(`Code matched = ${decodedText}`, decodedResult);
this.qrResultString = decodedText;
this.utilitiesService.delay(1000); // this is just a ms delay function
html5QrCode.stop();
this.dismissModal(); // our own function to close the modal (we are using Ionic)
}
};
const onScanFailure = (error) => {
};
// If you want to prefer back camera
html5QrCode.start({ facingMode: 'environment' }, config, onScanSuccess, onScanFailure);
}
HTML:
<div style="width: 100%">
<div id="qr-reader" class="qr-reader"></div>
</div>
CSS:
.barcodeModal {
z-index: 1;
}
.qr-reader {
display: inline-block;
}
from html5-qrcode.
Related Issues (20)
- Barcode 39 is scanned unreliably on Android HOT 1
- setTimout violation problem
- Not scanning white barcodes
- [Feature Request] Make it easier to override this package with local changes.
- QR-code image scanning feature get Bug !
- iphone error: undefined is not an object HOT 1
- Compatibility - [IOS] [Chrome , Safari] - Iphones aren't reading barcode HOT 1
- Two cameras appear if reloading implement with next js HOT 1
- Qr code can't be read
- possible to drop the requirement for HTTPS on local network testing? HOT 2
- [Feature Request] please support SCAN_TYPE_CANVAS
- Could I use the close button(X) to stop scanner and close camera rather than smaller it ?
- Compatibility - [IOS 17.4.1] [Google Chrome] - Stuck on scanner HOT 2
- Why is the Huawei phone equipped with a front camera, while other phones have a rear camera
- problem with MMVCServerSIO_win_onnxgpu-cuda_v.1.5.3.18a.zip
- [Feature Request] The ability to translate the texts of buttons and labels
- Scan app on hot desking app not working HOT 1
- Why qrbox not show in iOS fullScreen
- [Feature Request] Polish interface language
- The built min.js cannot be used? HOT 1
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 html5-qrcode.