diff --git a/app/scripts/main.js b/app/scripts/main.js index 5751536c0..496702735 100644 --- a/app/scripts/main.js +++ b/app/scripts/main.js @@ -191,6 +191,7 @@ if(self.onframe) self.onframe(); coordinatesHaveChanged = false; + requestAnimationFrame(captureFrame); }; var getCamera = function(videoSource, cb) { @@ -221,7 +222,7 @@ var isSetup = setupVariables(e); if(isSetup) { - setInterval(captureFrame.bind(self), 4); + requestAnimationFrame(captureFrame.bind(self)); } else { // This is just to get around the fact that the videoWidth is not @@ -229,7 +230,7 @@ setTimeout(function() { setupVariables(e); - setInterval(captureFrame.bind(self), 4); + requestAnimationFrame(captureFrame.bind(self)); }, 100); }