Explain target option for livestream

This commit is contained in:
David Madner
2016-02-10 09:31:05 +01:00
parent 944d92cd9c
commit 6338aad923
+5 -1
View File
@@ -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"]