Closed Bug 1545817 Opened 5 years ago Closed 5 years ago

GeckoView never requests audio focus, so YouTube plays over other audio apps

Categories

(GeckoView :: Media, enhancement, P1)

68 Branch
All
Android
enhancement

Tracking

(firefox68 affected, firefox69 affected)

RESOLVED WONTFIX
Tracking Status
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.

James: who should be responsible for requesting audio focus: GV, AC, or the app code?

Fennec added audio focus only just a year ago.

Type: defect → enhancement
Flags: needinfo?(snorp)
Priority: -- → P2
Summary: GeckoView never requests audio focus, so Youtube plays over other audio apps → GeckoView never requests audio focus, so YouTube plays over other audio apps
Whiteboard: [geckoview:fenix:p3]

I think we should probably just handle it ourselves in Gecko. It looks like Chrome requests audio focus for media, but not Web Audio.

Flags: needinfo?(snorp)

Setting [geckoview:fenix:m7] because the Fenix issue is a P1: https://github.com/mozilla-mobile/fenix/issues/1753

Whiteboard: [geckoview:fenix:p3] → [geckoview:fenix:m7]

(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.

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.

Flags: needinfo?(s.kaspari)

(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

Flags: needinfo?(s.kaspari)

[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

Priority: P2 → P1

WONTFIX because the GV team says this is an app bug.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → WONTFIX

Moving some media bugs to the new GeckoView::Media component.

Component: General → Media
You need to log in before you can comment on or make changes to this bug.