From ca3e4b673ad62d8f6b4858bbb186983e5e8e30c7 Mon Sep 17 00:00:00 2001 From: Christoph Oberhofer Date: Tue, 29 Mar 2016 22:52:34 +0200 Subject: [PATCH] Fixed: Workers are terminated instead of re-usedin order to initialize them correctly --- src/config/config.prod.js | 6 +++--- src/quagga.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/config/config.prod.js b/src/config/config.prod.js index 3c66b78..2b58e43 100644 --- a/src/config/config.prod.js +++ b/src/config/config.prod.js @@ -5,9 +5,9 @@ module.exports = { constraints: { width: 640, height: 480, - minAspectRatio: 0, - maxAspectRatio: 100, - facing: "environment" // or user + // aspectRatio: 640/480, // optional + facingMode: "environment", // or user + // deviceId: "38745983457387598375983759834" }, area: { top: "0%", diff --git a/src/quagga.js b/src/quagga.js index 7843641..29bc4a0 100644 --- a/src/quagga.js +++ b/src/quagga.js @@ -520,9 +520,9 @@ export default { halfSample: false } }, config); - this.init(config, function() { - Events.once("processed", function(result) { - _stopped = true; + this.init(config, () => { + Events.once("processed", (result) => { + this.stop(); resultCallback.call(null, result); }, true); start();