androidx / androidx/media

Do not request audio focus if the played video has no audio

Open
#724 3 comments 3 reactions 1 assignee View on GitHub

@tonihei is already working on this.

Since Oct 16, 2023.

enhancement
Dominant language
Java
Stars
3k
Forks
955
Avg merge
12d 14h
Merged PRs (30d)
2

Description

Use case description

When setting up exoplayer by calling ExoPlayer.setAudioAttributes(...) with handleAudioFocus set to true, the audio focus is always requested even when the video file contains no audio tracks or all audio tracks have been disabled.

This means that the burden of deciding whether the audio focus should really be requested or not is on the application, which would then need to inspect the content of the video file.

Proposed solution

When handleAudioFocus==true, Exoplayer should NOT actually request the audio focus when either the video contains no audio tracks or when all audio tracks have been disabled.

Alternatives considered

Rename handleAudioFocus argument to requestAudioFocus to at least make expectations clearer.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.