Open sonicdebris opened 1 year ago
(see also internal ref: b/300917087)
Thanks for filing the issue. This has also been highlighted before (see internal ref I linked above) and I'll mark it as a feature request that should be handled by the library internally.
I also have a few use cases where I'm using the player to auto-play video previews that contain audio but the audio is muted. It would be nice if the player only requested audio focus if there's actual audio playing.
Use case description
When setting up exoplayer by calling
ExoPlayer.setAudioAttributes(...)
withhandleAudioFocus
set totrue
, 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 torequestAudioFocus
to at least make expectations clearer.