Issue metadata
Sign in to add a comment
|
Gamepad not working in WebChromeClient
Reported by
westb...@gmail.com,
Nov 17
|
||||||||||||||||||||||
Issue descriptionSteps to reproduce the problem: Gamepads work on Chrome running on Android TV but when in my android app which is a web view using WebChromeClient no gamepads are detected. What is the expected behavior? Using the WebView and WebChromeClient I would expect gamepad support to be enabled. What went wrong? No gamepads are detetected in javascript when using the webview. Did this work before? N/A Does this work in other browsers? Yes Chrome version: 70.0.3538.102 Channel: stable OS Version: TV Flash Version:
,
Nov 19
This is my code inside the Activity class:
WebView webView = findViewById(R.id.myWebView);
WebChromeClient client = new WebChromeClient();
webView.setWebChromeClient(client);
webView.getSettings().setJavaScriptEnabled(true);
This is the javascript gameloop code from my site:
function gameLoop(){
let gamepads = navigator.getGamepads();
requestAnimationFrame(gameLoop);
}
gameLoop();
gamepads is always an array of 4 nulls, no errors just that no gamepads are detected even after mashing buttons on the gamepad.
When I run the same site using chrome on the same device gamepads[0] has a object set.
,
Nov 19
Thank you for providing more feedback. Adding the requester to the cc list. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Nov 20
@westbrma: Please provide above code in form of app/html file. This would be easier for TE to check. Thanks!
,
Nov 21
mattreynolds@ is the Gamepad API supposed to work in a WebView?
,
Nov 21
I guess I assumed it should since it works in Chrome
,
Nov 21
Thank you for providing more feedback. Adding the requester to the cc list. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Nov 27
Hey guys, gamepad api is totally broken on Android devices since chrome 70. It was worked before, but now navigator.getGamepads() returns empty list. To check gamepad you can use this website http://html5gamepad.com
,
Nov 28
Issue 909041 has been merged into this issue.
,
Nov 28
Tested the issue in Android and able to reproduce the issue. Steps Followed: 1. Navigated to http://html5gamepad.com 2. Connected Gamepad using cable, Pressed some buttons and not seeing any display info Chrome versions tested: 70.0.3538.110, 72.0.3623.2[latest canary] OS: Android 9.0.0 Android Devices: Pixel 2 XL Good Build - 70.0.3503.0 Bad Build - 70.0.3504.0 Unable to provide per-revision bisect as we do not have required hardware to connect gamepad and perform bisect simultaneously, hence providing manual cl. CL: https://chromium.googlesource.com/chromium/src/+log/70.0.3503.0..70.0.3504.0?pretty=fuller&n=10000 Suspecting https://chromium.googlesource.com/chromium/src/+/3ccb3a896b8cc61114a33c203bec28a93cfad8e6 from the changelog. @ jinsukkim: Could you please look into the issue, pardon me if it has nothing to do with your changes and if possible please assign it to owner concerned. Adding RB-Stable for M-70, Please remove if this not the case. Thanks!
,
Nov 29
Friendly ping to look into this issue and to provide further update on this issue as it has been marked as a stable blocker. Thanks!
,
Nov 29
I can take a look once I get a gamepad controller.
,
Nov 30
This will not block the M71 release.
,
Dec 1
,
Dec 3
Friendly ping for an update on this issue as it is marked as stable blocker & stable release is coming soon. Thanks!
,
Dec 3
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/00ebecafc6766ac90c9d50ecf8c28a1441a053d3 commit 00ebecafc6766ac90c9d50ecf8c28a1441a053d3 Author: Jinsuk Kim <jinsukkim@chromium.org> Date: Mon Dec 03 21:50:49 2018 Android: Fix a bug not supporting gamepad https://crrev.com/c/1135874 left out checking gamepad events by mistake. This CL fixes it by adding the check against GenericMotionEvent in the content ui event handler. Tested on https://html5gamepad.com with a USB gamepad. Bug: 906347 Change-Id: I2bd0890f2533e70a772dbb0b005d69bf086d1595 Reviewed-on: https://chromium-review.googlesource.com/c/1356727 Reviewed-by: Bo <boliu@chromium.org> Commit-Queue: Jinsuk Kim <jinsukkim@chromium.org> Cr-Commit-Position: refs/heads/master@{#613268} [modify] https://crrev.com/00ebecafc6766ac90c9d50ecf8c28a1441a053d3/content/public/android/java/src/org/chromium/content/browser/ContentUiEventHandler.java [modify] https://crrev.com/00ebecafc6766ac90c9d50ecf8c28a1441a053d3/content/public/android/java/src/org/chromium/content/browser/Gamepad.java
,
Dec 3
,
Dec 4
,
Dec 4
Your change meets the bar and is auto-approved for M72. Please go ahead and merge the CL to branch 3626 manually. Please contact milestone owner if you have questions. Owners: govind@(Android), kariahda@(iOS), djmm@(ChromeOS), abdulsyed@(Desktop) For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Dec 4
Pls merge your change to M72 branch 3626 ASAP so we can pick it up for tomororw's dev release. Thank you.
,
Dec 5
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/fd35126e1ea5bc0cae31cdde86a2d779fd438646 commit fd35126e1ea5bc0cae31cdde86a2d779fd438646 Author: Jinsuk Kim <jinsukkim@chromium.org> Date: Wed Dec 05 00:58:59 2018 Android: Fix a bug not supporting gamepad https://crrev.com/c/1135874 left out checking gamepad events by mistake. This CL fixes it by adding the check against GenericMotionEvent in the content ui event handler. Tested on https://html5gamepad.com with a USB gamepad. TBR=boliu@chromium.org Bug: 906347 Change-Id: I2bd0890f2533e70a772dbb0b005d69bf086d1595 Reviewed-on: https://chromium-review.googlesource.com/c/1356727 Reviewed-by: Bo <boliu@chromium.org> Commit-Queue: Jinsuk Kim <jinsukkim@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#613268}(cherry picked from commit 00ebecafc6766ac90c9d50ecf8c28a1441a053d3) Reviewed-on: https://chromium-review.googlesource.com/c/1361750 Reviewed-by: Jinsuk Kim <jinsukkim@chromium.org> Cr-Commit-Position: refs/branch-heads/3626@{#58} Cr-Branched-From: d897fb137fbaaa9355c0c93124cc048824eb1e65-refs/heads/master@{#612437} [modify] https://crrev.com/fd35126e1ea5bc0cae31cdde86a2d779fd438646/content/public/android/java/src/org/chromium/content/browser/ContentUiEventHandler.java [modify] https://crrev.com/fd35126e1ea5bc0cae31cdde86a2d779fd438646/content/public/android/java/src/org/chromium/content/browser/Gamepad.java
,
Dec 5
,
Dec 19
,
Dec 19
Has this gone out to users yet? What version will it be available in? Sorry if this is obvious, but I'm new to the chromium project, and this bug tracker tool.
,
Dec 19
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/fd35126e1ea5bc0cae31cdde86a2d779fd438646 Commit: fd35126e1ea5bc0cae31cdde86a2d779fd438646 Author: jinsukkim@chromium.org Commiter: jinsukkim@chromium.org Date: 2018-12-05 00:58:59 +0000 UTC Android: Fix a bug not supporting gamepad https://crrev.com/c/1135874 left out checking gamepad events by mistake. This CL fixes it by adding the check against GenericMotionEvent in the content ui event handler. Tested on https://html5gamepad.com with a USB gamepad. TBR=boliu@chromium.org Bug: 906347 Change-Id: I2bd0890f2533e70a772dbb0b005d69bf086d1595 Reviewed-on: https://chromium-review.googlesource.com/c/1356727 Reviewed-by: Bo <boliu@chromium.org> Commit-Queue: Jinsuk Kim <jinsukkim@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#613268}(cherry picked from commit 00ebecafc6766ac90c9d50ecf8c28a1441a053d3) Reviewed-on: https://chromium-review.googlesource.com/c/1361750 Reviewed-by: Jinsuk Kim <jinsukkim@chromium.org> Cr-Commit-Position: refs/branch-heads/3626@{#58} Cr-Branched-From: d897fb137fbaaa9355c0c93124cc048824eb1e65-refs/heads/master@{#612437}
,
Dec 31
Issue 918241 has been merged into this issue. |
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by chelamcherla@chromium.org
, Nov 19Labels: Needs-triage-Mobile Triaged-Mobile Needs-Feedback