Merge branch 'JauernigIT-scanDelay'

pull/97/merge
Christoph Oberhofer 9 years ago
commit a83940daa1

@ -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) {

Loading…
Cancel
Save