mirror of
https://github.com/serratus/quaggaJS.git
synced 2026-08-12 21:21:42 +08:00
new config variable scanDelay to add some time between two scans
This commit is contained in:
+6
-1
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user