I'm trying to gauge the feasibility of an idea I have for a game. I'd like to make the game as a web app (or possibly a PWA), with support for a controller/gamepad, and usable on mobile browswers (eg Android Chrome).
To see if this is possible, I'm trying to connect an Xbox One S controller I have via bluetooth, and test it with http://html5gamepad.com/. When I connect the controller to my computer and try it, the controller is picked up just fine. However, when I connect it to my Android phone (Pixel 3), and visit that site in the Chrome (71.0.3578.98) browser, it does not recognize the device at all.
I also tested this with a small html & javascript page served up via express and available over ngrok, using window.addEventListener("gamepadconnected", ...)
and navigator.getGamepads()
as my test, but that isn't recognizing it either.
I also tested with another phone (Samsung Galaxy Note 3), and experienced the same behavior.
The controller is definitely connected to my phone, because I can use it to navigate around my home screen, and I can even move between web pages in the browser, but it seems like the events are not passed to the page for some reason.
Update: I just tried this on Firefox on my phone and it worked, so I guess maybe I'll submit a bug report to Android Chrome's buglist, if that's publicly available.