mirror of
https://github.com/serratus/quaggaJS.git
synced 2026-08-12 21:21:42 +08:00
Merge branch 'JauernigIT-scanDelay'
This commit is contained in:
+19
-6
@@ -296,16 +296,29 @@ function update() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function start() {
|
function startContinuousUpdate() {
|
||||||
|
var next = null,
|
||||||
|
delay = 1000 / (_config.frequency || 60);
|
||||||
|
|
||||||
_stopped = false;
|
_stopped = false;
|
||||||
( function frame() {
|
(function frame(timestamp) {
|
||||||
|
next = next || timestamp;
|
||||||
if (!_stopped) {
|
if (!_stopped) {
|
||||||
update();
|
if (timestamp >= next) {
|
||||||
if (_onUIThread && _config.inputStream.type === "LiveStream") {
|
next += delay;
|
||||||
window.requestAnimFrame(frame);
|
update();
|
||||||
}
|
}
|
||||||
|
window.requestAnimFrame(frame);
|
||||||
}
|
}
|
||||||
}());
|
}(performance.now()));
|
||||||
|
}
|
||||||
|
|
||||||
|
function start() {
|
||||||
|
if (_onUIThread && _config.inputStream.type === "LiveStream") {
|
||||||
|
startContinuousUpdate();
|
||||||
|
} else {
|
||||||
|
update();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function initWorker(cb) {
|
function initWorker(cb) {
|
||||||
|
|||||||
Reference in New Issue
Block a user