New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 680910 link

Starred by 3 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

AVRCP play/ pause is not working with HTML5 video in webview

Reported by howard....@mediatek.com, Jan 13 2017

Issue description

Example URL:

Steps to reproduce the problem:
1. pair a bluetooth headset with phone
2. launch webview shell, open http://m.youtube.com, play any video
3. press the play/pause button on the headset

What is the expected behavior?

What went wrong?
Unable to control the HTML video with the play/pause button on headset.

Did this work before? No 

Is it a problem with Flash or HTML5? HTML5

Does this work in other browsers? N/A

Chrome version: 55.0.2883.91  Channel: stable
OS Version: 7.1.1
Flash Version: N/A

Contents of chrome://gpu: 

AVRCP play/pause works with chrome.
This issue only happens in webview.
 
Components: -Internals>Media Mobile>WebView
Cc: ti...@chromium.org
CC'ing Tima, because this is video related.
Owner: ntfschr@chromium.org
Status: Started (was: Unconfirmed)
I'll begin investigation today
Cc: avayvod@chromium.org timvolod...@chromium.org
Labels: -Arch-x86_64
CC'ing avayvod@, since he owns the chrome code for this feature.

We had a hack that used to work in L & M, but we probably need real componentization to get this working for N+.

A brief explanation of why this used to work, and why it's broken for N+.

timvolodine@ actually added some support for this a long time ago (see crbug/479786).

This sort of worked in L & M. Clicking "play/pause" twice (clicking once does nothing) would remove focus away from the player. This triggers AudioManager.OnAudioFocusChangeListener, which tries to pause the video. If the video is playing, this will pause it. If the video is already paused, it will do nothing (instead of resuming, which is what the user really wants).

Something must have changed in N+, because the listener is never called.


Chrome has code specially designed to handle this:

https://cs.chromium.org/chromium/src/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaNotificationManager.java
https://cs.chromium.org/chromium/src/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaSessionTabHelper.java

avayvod@, do you think it would be worth the effort to componentize parts of this code for WebView's sake? Or is there a better way for WebView to properly add this support?
Labels: -Pri-2 Pri-3
Status: Available (was: Started)
I obviously haven't had the time to work on this, so I'm opening this up for any webview member to take up.
Owner: ----

Comment 8 by ti...@chromium.org, Jun 20 2017

Owner: ti...@chromium.org
Status: Assigned (was: Available)
Owner: ----
Status: Available (was: Assigned)
Opening this back up. I don't think this is worth the effort (lots of componentization)
Project Member

Comment 10 by sheriffbot@chromium.org, Aug 30

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: -ti...@chromium.org
Status: Available (was: Untriaged)
Labels: Valid-Difficult-Fix
Cc: beccahughes@chromium.org mlamouri@chromium.org
+becca who is working on some MediaSession stuff. I don't know if this in the roadmap though.
Components: Internals>Media>Session
Pardon me for imposing, but I think this bug below is a duplicate of this. If they could be merged, it would be appreciated.

I work with the "Made for Google" third-party certification team, and would be glad to relay any data if it would be helpful. One of our partners' engineers similarly expressed interest in this issue.

https://bugs.chromium.org/p/chromium/issues/detail?id=870530
I suspect these issues are not duplicates. This is broken on WebView because the code handling these inputs simply does not exist (last I checked, the code lives in chrome layer). As we determined on the other issue, this is not ARC++, so it appears something else is broken for ChromeOS (and perhaps for other platforms too).
We are moving media session to //services so if layer boundaries are a problem then this might fix that.

Sign in to add a comment