Recoded Gamepad detection to stop it breaking on FF.

This commit is contained in:
photonstorm 2014-06-02 00:48:09 +01:00
parent c025b95959
commit 1d428a7ca4

View file

@ -226,7 +226,18 @@ Phaser.Gamepad.prototype = {
*/
_pollGamepads: function () {
var rawGamepads = navigator.getGamepads() || (navigator.webkitGetGamepads && navigator.webkitGetGamepads()) || navigator.webkitGamepads;
if (navigator['getGamepads'])
{
var rawGamepads = navigator.getGamepads();
}
else if (navigator['webkitGetGamepads'])
{
var rawGamepads = navigator.webkitGetGamepads();
}
else if (navigator['webkitGamepads'])
{
var rawGamepads = navigator.webkitGamepads();
}
if (rawGamepads)
{