new config variable scanDelay to add some time between two scans

pull/95/head
Matthias Jauernig 9 years ago
parent 82ef5b9397
commit 9b1e697609

@ -360,6 +360,7 @@ function workerInterface(factory) {
var imageWrapper; var imageWrapper;
self.onmessage = function(e) { self.onmessage = function(e) {
setTimeout(function() {
if (e.data.cmd === 'init') { if (e.data.cmd === 'init') {
var config = e.data.config; var config = e.data.config;
config.numOfWorkers = 0; config.numOfWorkers = 0;
@ -375,6 +376,7 @@ function workerInterface(factory) {
} else if (e.data.cmd === 'setReaders') { } else if (e.data.cmd === 'setReaders') {
Quagga.setReaders(e.data.readers); Quagga.setReaders(e.data.readers);
} }
}, Quagga.getConfig().scanDelay || 0);
}; };
function onProcessed(result) { function onProcessed(result) {
@ -516,5 +518,8 @@ export default {
}, },
ImageWrapper: ImageWrapper, ImageWrapper: ImageWrapper,
ImageDebug: ImageDebug, ImageDebug: ImageDebug,
ResultCollector: ResultCollector ResultCollector: ResultCollector,
getConfig: function getConfig() {
return _config;
}
}; };

Loading…
Cancel
Save