mirror of
https://github.com/serratus/quaggaJS.git
synced 2026-08-13 05:31:37 +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;
|
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;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user