Skip to content

freaker2k7/meteor-qr-code-scanner

 
 

Repository files navigation

Meteor QR Code Scanner

A no-nonsense QR Code Scanner for Meteor

This package uses the getUserMedia stream API to record webcam or front-facing mobile cameras, constantly scanning frames to read and decode QR codes. The entire package is client-side only.

qr-scanner is made possible by jsqrcode.

Quickstart

Install with Meteorite.

$ mrt add qr-scanner

Add the video streaming template to your app.

{{> qrScanner}}

You can access the latest succesfully decoded message through the reactive variable message.

Template.myTmpl.qrCode = -> qrScanner.message()

You can also bind a callback to the scan event, which will be fired each time a scan takes place - every 500ms - even if no message is found.

qrScanner.on 'scan', (err, message) ->
  alert(message) if message?

Image Data

At any time you can access image data from the scanner using the following:

  qrScanner.imageData()     # ctx.getImageData()
  qrScanner.imageDataURL()  # canvas.toDataURL("image/jpeg")

Video Quality

You can specify a relatively specific video resolution if you want, but it can become a jumpy on mobile devices. More pixel data is needed to be analysed with higher resolutions.

{{> qrScanner w=1024 h=768}}

The default resolution is 320 x 240 px, which works smoothly and effectively on a Galaxy S4.

Todo

  • API for accessing scanned image data

## Credits / Licenses

About

A no-nonsense QR Code Scanner for Meteor (using jsqrcode)

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 97.4%
  • CoffeeScript 2.3%
  • Other 0.3%