Skip to content

Commit

Permalink
fix startContinuousUpdate() so LiveStream works again
Browse files Browse the repository at this point in the history
  • Loading branch information
ericblade committed Apr 29, 2020
1 parent f338e49 commit da2445f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
21 changes: 11 additions & 10 deletions src/common/typedefs.js
Expand Up @@ -4,16 +4,17 @@
*/

if (typeof window !== 'undefined') {
window.requestAnimFrame = (function () {
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function (/* function FrameRequestCallback */ callback) {
window.setTimeout(callback, 1000 / 60);
};
}());
if (!window.requestAnimationFrame) {
window.requestAnimationFrame = (function () {
return window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function (/* function FrameRequestCallback */ callback) {
window.setTimeout(callback, 1000 / 60);
};
}());
}
}
Math.imul = Math.imul || function(a, b) {
var ah = (a >>> 16) & 0xffff,
Expand Down
3 changes: 1 addition & 2 deletions src/quagga/quagga.ts
Expand Up @@ -226,8 +226,7 @@ export default class Quagga {
next += delay;
this.update();
}
// @ts-ignore // TODO: requestAnimFrame is filled in src/common/typedefs.js, i'm not sure how to tell TypeScript of that, though
window.requestAnimFrame(frame);
window.requestAnimationFrame(newFrame);
};

newFrame(performance.now());
Expand Down

0 comments on commit da2445f

Please sign in to comment.