Closed aljohnston112 closed 1 week ago
I did find that onPlayWhenReadyChanged
is triggered with reason PLAY_WHEN_READY_CHANGE_REASON_AUDIO_FOCUS_LOSS
when audio focus is lost. If that is what the intended behavior is, feel free to close this ticket.
Yes, this is the intended behavior. Note that there is a difference between onPlaybackSuppressionReasonChanged(PLAYBACK_SUPPRESSION_REASON_TRANSIENT_AUDIO_FOCUS_LOSS)
(= transient, short-lived suppression with automatic resumption) and onPlayWhenReadyChanged(PLAY_WHEN_READY_CHANGE_REASON_AUDIO_FOCUS_LOSS)
(=a permanent focus loss, no automatic resumption).
Version
Media3 main branch
More version details
Devices that reproduce the issue
Pixel 8 Android 14
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Not tested
Reproduction steps
Expected result
As described here: https://github.com/google/ExoPlayer/issues/10293
When playback is stopped due to loss of audio focus, Player.Listener.onPlaybackSuppressionReasonChanged will be called with reason Player.PLAYBACK_SUPPRESSION_REASON_TRANSIENT_AUDIO_FOCUS_LOSS.
The event included in Player.Listener.onEvents() with key EVENT_PLAYBACK_SUPPRESSION_REASON_CHANGED.
Actual result
Neither of the two expected results happen.
Media
Not applicable
Bug Report
adb bugreport
to android-media-github@google.com after filing this issue.