google / google/ExoPlayer

Support for delayed focus gain

Open
#10,340 2 comments 0 reactions 1 assignee Claimed by @tonihei View on GitHub
enhancement
Dominant language
Java
Stars
21.9k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

### Use case description
When a media app requests audio focus, it might not be able to get it right away because the focus is "locked" by another app (_e.g._, when a music streaming app requests audio focus during a phone call). Such use cases can be handled within Android through the use of delayed focus gain (see https://developer.android.com/guide/topics/media-apps/audio-focus#delayed-focus-gain). However, as far as I can tell, ExoPlayer doesn't support that feature yet.

### Proposed solution
Add support for delayed focus gain - https://developer.android.com/guide/topics/media-apps/audio-focus#delayed-focus-gain.

### Alternatives considered
- There are workaround-ish ways to handle these use cases (_e.g._, requesting audio focus multiple times) but they are cumbersome and error-prone.
- A more comprehensive option would be to support greater customisation of the SimpleExoPlayer/ExoPlayerImpl classes. A case in point: allowing users to slightly customise the AudioFocusManager used by the player.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.