From 6338aad92317e88621b4c27d456ca0e9fea9dc18 Mon Sep 17 00:00:00 2001 From: David Madner Date: Wed, 10 Feb 2016 09:31:05 +0100 Subject: [PATCH] Explain target option for livestream --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9adcb30..c7b0448 100644 --- a/README.md +++ b/README.md @@ -120,11 +120,15 @@ may be the `inputStream.type` is set to `LiveStream`, but the browser does not support this API, or simply if the user denies the permission to use the camera. +If you do not specify a target, QuaggaJS would look for an element that matches the CSS selector `#interactive.viewport` (for backwards compatibility). +`Target` can be a string (CSS selector matching one of your DOM node) or a DOM node. + ```javascript Quagga.init({ inputStream : { name : "Live", - type : "LiveStream" + type : "LiveStream", + target: document.querySelector('#yourElement') // Or '#yourElement' (optional) }, decoder : { readers : ["code_128_reader"]