diff --git a/js/gamepad.js b/js/gamepad.js index c1d4f80..bf86e1d 100644 --- a/js/gamepad.js +++ b/js/gamepad.js @@ -1,6 +1,9 @@ class Gamepad { constructor() { this.haveEvents = 'GamepadEvent' in window; + this.rAF = window.mozRequestAnimationFrame || + window.webkitRequestAnimationFrame || + window.requestAnimationFrame; // cached DOM references this.$gamepad = $('.gamepad'); @@ -288,7 +291,7 @@ class Gamepad { } // enqueue the next refresh right away - requestAnimationFrame(this.updateVisualStatus.bind(this)); + this.rAF(this.updateVisualStatus.bind(this)); // load latest gamepad data this.refreshGamepads();