1.1.5 • Published 6 months ago
@vandrei/qrcode-scanner v1.1.5
Scanner
This project was generated with Angular CLI version 14.2.11.
Development server
For use install
- npm i jsqr --save
Simple scanner to qrcode.
When To Use
this scanner is used when you need to get information from qrcode using angular/ionic application. is recommended for pwa also
this lib use
https://github.com/cozmo/jsQR
Demo
API
import { QrcodeScannerModule } from 'qrcode-scanner';
<qrcode-scanner (resultEvent)="result($event)" [config]="yourConfig"></qrcode-scanner>
qrcode-scanner
Property | Description | Type | Default | Global Config |
---|---|---|---|---|
[config] | this config hava a default but you can send a custom config | IVideoConfig | ||
(resultEvent) | this is return of scanned qrcode | string | empty |
Default config and structure exemple
const VIDEO_CONFIG = {
video: {
width: {min: 250, max: 450, ideal: 400},
height: {min: 250, max: 450, ideal: 400},
facingMode: 'enviroment'
}
}
QrcodeScannerService
Property | Description | Type |
---|---|---|
result$ | BehaviorSubject return and save qrcode data | BehaviorSubject - string |
errors$ | Subject return internal erros | Subject - string |
changeCamera$ | Subject trigger change camera | Subject - void |