GeckoView never requests audio focus, so YouTube plays over other audio apps
Categories
(GeckoView :: Media, enhancement, P1)
Tracking
(firefox68 affected, firefox69 affected)
People
(Reporter: colee, Unassigned)
References
Details
(Whiteboard: [geckoview:fenix:m7])
Currently, GeckoView does not request audio focus when playing significant audio streams from the web. This means that if I launch Spotify and then open YouTube inside Fenix, YouTube and Spotify will play at the same time. Here's the bug report Fenix received:
https://github.com/mozilla-mobile/fenix/issues/1753
We need to decide if GeckoView will own requesting audio focus or if Android Components or the client apps should own it.
Whichever area owns this, we'll need to design an appropriate metric for when to request focus. Fennec is aggressive at obtaining audio focus and stops other apps even when a short beep occurs on a page. This behavior may be fine for Fenix MVP though. Chrome seems to request audio focus in a way that doesn't interrupt other apps for minor sounds, but does interrupt for YouTube and other videos.
Comment 1•5 years ago
|
||
James: who should be responsible for requesting audio focus: GV, AC, or the app code?
Fennec added audio focus only just a year ago.
Comment 2•5 years ago
•
|
||
I think we should probably just handle it ourselves in Gecko. It looks like Chrome requests audio focus for media, but not Web Audio.
Comment 3•5 years ago
|
||
Setting [geckoview:fenix:m7] because the Fenix issue is a P1: https://github.com/mozilla-mobile/fenix/issues/1753
Comment 4•5 years ago
|
||
(In reply to Chris Peterson [:cpeterson] from comment #1)
James: who should be responsible for requesting audio focus: GV, AC, or the app code?
(In reply to James Willcox (:snorp) (jwillcox@mozilla.com) (he/him) from comment #2)
I think we should probably just handle it ourselves in Gecko. It looks like Chrome requests audio focus for media, but not Web Audio.
I'm open to discussing this: We've build this media state machine that looks at all media for all sessions to derive a "media state" that we can use to implement MediaSession
and display the notification. So since we know whether we are in "playing" state or transitioned to it, we could just request audio focus too.
Comment 5•5 years ago
|
||
James recommends we WONTFIX this GV bug because A-C can handle the audio focus.
@ Sebastian, is there an A-C issue filed for this? If not, I can file a new A-C issue and link it to the Fenix issue mozilla-mobile/fenix#1753.
Comment 6•5 years ago
|
||
(In reply to Chris Peterson [:cpeterson] from comment #5)
James recommends we WONTFIX this GV bug because A-C can handle the audio focus.
@ Sebastian, is there an A-C issue filed for this? If not, I can file a new A-C issue and link it to the Fenix issue mozilla-mobile/fenix#1753.
https://github.com/mozilla-mobile/android-components/issues/2451
Comment 7•5 years ago
|
||
[geckoview:fenix:m7]
bugs should be priority P1.
I'm editing a bunch of GeckoView bugs. If you'd like to filter all this bugmail, search and destroy emails containing this UUID:
e88a5094-0fc0-4b7c-b7c5-aef00a11dbc9
Comment 8•5 years ago
|
||
WONTFIX because the GV team says this is an app bug.
Updated•5 years ago
|
Comment 9•2 years ago
|
||
Moving some media bugs to the new GeckoView::Media component.
Description
•