Fix audio ducking issue by using Android's automatic audio focus management#13169
Fix audio ducking issue by using Android's automatic audio focus management#13169eubnara wants to merge 2 commits intoTeamNewPipe:devfrom
Conversation
…gement Previously, manual audio focus handling caused volume to not be restored after transient ducking on some devices. This change removes manual AudioFocusRequest management and relies on ExoPlayer's built-in audio focus handling (handleAudioFocus=true), which properly manages automatic ducking as recommended in: https://developer.android.com/media/optimize/audio-focus#automatic-ducking Fixes TeamNewPipe#9710
af995e2 to
3c58b34
Compare
|
Successfully tested on a Samsung Galaxy S25 Ultra with Android 16 / OneUI 8.0; |
|
Thank you! |
TobiGr
left a comment
There was a problem hiding this comment.
This PR breaks the mute option in the main player.
Play a video in NewPipe and use mute. Open a different app and play audio. I do not think that this is the correct approach. We need to fix this differently and keep the manual audio focus management.
| if (wasMuted) { | ||
| audioReactor.requestAudioFocus(); | ||
| } else { | ||
| audioReactor.abandonAudioFocus(); | ||
| } |
There was a problem hiding this comment.
this change breaks the mute functionality. IT is not possible anymore to play audio in a different app and watch a video simultaneously.
There was a problem hiding this comment.
Thanks for reply. I'll figure it out.
There was a problem hiding this comment.
@TobiGr
I fixed it. Could you review it again please?
Thanks!!
This comment was marked as outdated.
This comment was marked as outdated.
It should play video with mute on even though another app is playing audio.
|
Successfully tested the new/fixed build on a Samsung Galaxy S25 Ultra with Android 16 / OneUI 8.0; |
What is it?
refactorbranchDescription of the changes in your PR
Fix audio ducking issue by using Android's automatic audio focus management
Previously, manual audio focus handling caused volume to not be restored after transient ducking on some devices.
This change removes manual AudioFocusRequest management and relies on ExoPlayer's built-in audio focus handling (handleAudioFocus=true), which properly manages automatic ducking as recommended in: https://developer.android.com/media/optimize/audio-focus#automatic-ducking Fixes #9710
Fixes the following issue(s)
APK testing
The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. You can find more info and a video demonstration on this wiki page.
Due diligence