-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Audiofocus Broken after AUDIOFOCUS_LOSS_TRANSIENT #7182
Comments
It would be great if a fix went already into the next release as this bug renders exoplayer completely unusable. |
I can't reproduce this using normal phone calls (which should be the same in terms of how audio focus works). Are you sure this isn't a Due issue? |
I think it's a Duo bug where they should be releasing audio focus but aren't. If you kill the Duo process after the call then playback does resume. That said, the state ExoPlayer ends up in is definitely non-ideal (it's waiting indefinitely for Duo to release audio focus, which it's not doing). If the user toggles to pause and back to play, we should be more aggressive at trying to take audio focus back.
Has it also been "completely unusable" for the past 18 months, because the current behaviour appears to have existed ever since we added audio focus management in 2.9.0 :)... |
Ah very interesting. In my testing it was working with UAMP and exoplayer 2.10.0 So there definitely is a behavior change anywhere. Maybe introduced to the change with the event handler introduced between these releases.
Yes that's a very good idea. |
I reported the Duo issue to the relevant team [Internal ref: 153249585] |
This avoids cases where audio focus is never successfully acquired because another app is holding on to transient audio focus indefinitely. Issue: #7182 PiperOrigin-RevId: 305108528
If we're in the ducked state and updateAudioFocus is called with a new state for which focus is no longer required, we should restore the player back to full volume. Issue: #7182 PiperOrigin-RevId: 305232155
User recovery should be possible with the first of the two patches referenced above. The second patch fixes an additional edge case we discovered, but is unlikely to occur in practice. |
This avoids cases where audio focus is never successfully acquired because another app is holding on to transient audio focus indefinitely. Issue: #7182 PiperOrigin-RevId: 305108528
If we're in the ducked state and updateAudioFocus is called with a new state for which focus is no longer required, we should restore the player back to full volume. Issue: #7182 PiperOrigin-RevId: 305232155
Please verify with dev-v2-r2.11.4 if possible, prior to us cutting the release. The cherry-pick wasn't totally straightforward, so verification would be appreciated. |
I couldn't verify it before the release. |
On ExoPlayer 2.11.3, audiofocus is broken when receiving a
AUDIOFOCUS_LOSS_TRANSIENT
.In that case the AudioFocusManager receives no furhter events and exoplayer is unable to play any longer.
This can be reproduced using the following steps:
Now after the call the UI still shows playing but isn't. This can only be fixed by using another media player and let it request audio focus.
The text was updated successfully, but these errors were encountered: