Coder Social home page Coder Social logo

anthonkurniawan / meteor-qr-code-scanner Goto Github PK

View Code? Open in Web Editor NEW

This project forked from istoramandiri/meteor-qr-code-scanner

0.0 2.0 0.0 228 KB

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

CoffeeScript 2.85% HTML 0.33% JavaScript 96.76% CSS 0.05%

meteor-qr-code-scanner's Introduction

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.

By default, qr-scanner will use the 'environment facing' camera (the main camera for smartphones) and falls back to 'face facing'.

qr-scanner is made possible by jsqrcode.

Quickstart

Install with Meteor.

meteor add hitchcott:qr-scanner

Add the video streaming template to your app.

{{> qrScanner}}

You can access the latest successfully 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 analyzed with higher resolutions. The default is 640 x 480.

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

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

## Stop Capture

Use the following to stop capturing

qrScanner.stopCapture()

## Credits / Licenses

meteor-qr-code-scanner's People

Contributors

istoramandiri avatar frabrunelle avatar freaker2k7 avatar

Watchers

James Cloos avatar Anthon Kurniawan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.