Skip to content

Latest commit

 

History

History
83 lines (55 loc) · 4.15 KB

README.md

File metadata and controls

83 lines (55 loc) · 4.15 KB

@zxing/ngx-scanner

Angular QR-Code scanner component.

Report a bug · Request feature

NPM version Downloads dependencies Status Build Status Codacy Badge Join the chat at https://gitter.im/zxing-js/ngx-scanner

Features & Hints

  • Supports continuous scanning.
  • Supports iOS 11 (only in Safari via HTTPS --> see Limitations below).
  • There is a configurable delay of 1500ms after each successful scan, before a new QR-Code can be detected.
  • Nice devs behind it. 🤓

Demo

Previews needs to be opened in new standalone windows.

How To

We've built a veeeery cool Wiki for you! Click here to take a look!

I promise that it's very simple to use:

<!-- some.component.html -->
<zxing-scanner></zxing-scanner>

API

Method Parameters Returns Description
changeDevice device: MediaDeviceInfo void Allows you to properly change the scanner device on the fly.
camerasFound callback: (devices: MediaDeviceInfo[]) => {} EventEmitter<MediaDeviceInfo > Emits an event when cameras are found.
camerasNotFound callback: (): void => {} EventEmitter<void> Emits an event when cameras are not found.
scanSuccess callback: (result: string): void => {} EventEmitter<string> Emits an event when a scan is successful performed.
scanFailure callback: (): void => {} EventEmitter<void> Emits an event when a scan fails.
scanError callback: (error: any): void => {} EventEmitter<any> Emits an event when a scan throws an error.

Performance

Read our performance notes on the wiki: Performance Considerations.

Limitations

  • The component relies on zxing-typescript which currently supports totally the following code formats:
    • QR Code
    • Code 128
  • On iOS <= 11.2 devices camera access works only in native Safari. This is limited WebRTC support by Apple.

Generator

Looking for a way to generate QR-Codes? Check-out ngx-kjua