# HG changeset patch # User www-data # Date 1493378465 -3600 # Node ID c241f0aee8a4e2ced313a3a6bfa06ddd712c6ac9 # Parent 88649008134d275f7e840ed9d7280855480c1277# Parent 6b38dc6418124bffbeed72e8b02ace1282e53c5e Merge branch 'master' of https://github.com/BrechtDeMan/WebAudioEvaluationTool diff -r 88649008134d -r c241f0aee8a4 js/core.js --- a/js/core.js Tue Apr 25 16:21:05 2017 +0100 +++ b/js/core.js Fri Apr 28 12:21:05 2017 +0100 @@ -2903,32 +2903,20 @@ } } } + if (this.playbackObject !== undefined && this.interval === undefined) { + window.requestAnimationFrame(this.update.bind(this)); + } }; playhead.interval = undefined; playhead.start = function () { if (this.playbackObject !== undefined && this.interval === undefined) { - if (this.maxTime < 60) { - this.interval = window.setInterval(function () { - interfaceContext.playhead.update(); - }, 10); - } else { - this.interval = window.setInterval(function () { - interfaceContext.playhead.update(); - }, 100); - } + window.requestAnimationFrame(this.update.bind(this)); } }; playhead.stop = function () { - window.clearInterval(this.interval); - this.interval = undefined; - this.scrubberHead.style.left = '0px'; - if (this.maxTime < 60) { - this.curTimeSpan.textContent = '0.00'; - } else { - this.curTimeSpan.textContent = '00:00'; - } + this.timePerPixel = 0; }; return playhead; })();