More control over what happens when audio focus changes
Reported by
elisa.pe...@studiosol.com.br,
Feb 22 2018
|
||||||||||
Issue descriptionSteps to reproduce the problem: 1. Start playing media from WebView 2. Open device camera, or open a game or even try to send audio using WhatsApp (any action that requires audio focus) 3. Media from WebView stops What is the expected behavior? When playing media from WebView and other apps request audio focus, the app developer should be able to make the decision to pause media from WebView or not. What went wrong? WebView treats audio focus changes by its own. Sometimes the app developer wants to have this control to build a custom feature. Did this work before? N/A Does this work in other browsers? N/A Chrome version: 64.0.3282.137 Channel: stable OS Version: Flash Version: I work in an app that plays video using WebView while our users can leave the app and browse other apps and still see a mini video floating in the screen. But the video pauses every time the user enters a game or try to browse any content that request audio. Because of that our users are complaining a LOT about this issue and there is nothing we can do about it because web view pauses the media by its own :(
,
Feb 23 2018
Assuming this as Feature Request and updating the issue accordingly. Thanks!
,
Mar 9 2018
,
Mar 9 2018
*** Bulk edit *** Setting Feature Requests as: Untriaged
,
Mar 19 2018
Torne/Mounir, do you know how media stuff works in WebView? Would this be easy to fix, and would we want WebView to continue playing media when some other app requests audio focus?
,
Mar 29 2018
Mounir, was this an intentional change? In general this is the correct behaviour and what most applications would want, but since there's no way to control this behaviour then apps with unusual requirements are stuck. I don't know what the best way to allow this to be controlled would be (not familiar with any specifics of android's audio focus), but we'd need to add new APIs in a future android version and then perhaps disable this behaviour for webview on older platform versions, even though this will often be a worse result for apps :/
,
Mar 29 2018
,
Mar 29 2018
Not exactly the same, but 826715 is about audio focus too. Essentially boils down to, what is the current behavior, can apps control audio focus in webview.
,
Mar 30 2018
IIRC, when we added audio focus support in Chrome Android, we decided to include WebView too. I do not think this is something WebView offers an API to control. Possibly, content embedders can control it and it wouldn't be hard to make it so if not the case. I guess the question is how you want WebView to handle this.
,
Mar 30 2018
@boliu Regarding the issue no 826715, it would be good enough to be able to check (in some way) if WebView has focus. Since in my case host app and WebView are taking audioFocus one from each other. So for me is OK just to know if WebView has audioFocus or not.
,
Apr 9 2018
this is WebView bug. give to webview team to get enough attention.
,
Apr 9 2018
It's a feature request, and most definitely relevant to audio component.
,
Apr 27 2018
Dale, as per c#12, this is a feature request. what's your input?
,
May 4 2018
|
||||||||||
►
Sign in to add a comment |
||||||||||
Comment 1 by pnangunoori@chromium.org
, Feb 23 2018