From 484509931cefd218e4dabfeeebe2120b6ac6589b Mon Sep 17 00:00:00 2001 From: Christoph Oberhofer Date: Wed, 17 Dec 2014 23:29:47 +0100 Subject: [PATCH] Update README.md Added example to `Quagga.init(config)` --- README.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d0b1a85..29ad8f0 100644 --- a/README.md +++ b/README.md @@ -48,8 +48,23 @@ Basically the library exposes the following API: ### Quagga.init(config) -This method initializes the library for a given configuration (see below) which also includes a callback function (`readyFunc`) which is called when Quagga is ready to start. The initialization process also requests for camera access if real-time -detection is configured. +This method initializes the library for a given configuration (see below) which also includes a callback function (`readyFunc`) which is called when Quagga is ready to start. The initialization process also requests for camera access if real-time detection is configured. + +```javascript +Quagga.init({ + inputStream : { + name : "Live", + type : "LiveStream" + }, + decoder : { + readers : ["code_128_reader"] + }, + readyFunc : function() { + console.log("Initialization finished. Ready to start"); + Quagga.start(); + } +}); +``` ### Quagga.start()