new config variable scanDelay to add some time between two scans

This commit is contained in:
Matthias Jauernig
2016-03-22 09:51:15 +01:00
parent 82ef5b9397
commit 9b1e697609
+6 -1
View File
@@ -360,6 +360,7 @@ function workerInterface(factory) {
var imageWrapper;
self.onmessage = function(e) {
setTimeout(function() {
if (e.data.cmd === 'init') {
var config = e.data.config;
config.numOfWorkers = 0;
@@ -375,6 +376,7 @@ function workerInterface(factory) {
} else if (e.data.cmd === 'setReaders') {
Quagga.setReaders(e.data.readers);
}
}, Quagga.getConfig().scanDelay || 0);
};
function onProcessed(result) {
@@ -516,5 +518,8 @@ export default {
},
ImageWrapper: ImageWrapper,
ImageDebug: ImageDebug,
ResultCollector: ResultCollector
ResultCollector: ResultCollector,
getConfig: function getConfig() {
return _config;
}
};