Open brahmkshatriya opened 1 month ago
When the playback attempts to start during the phone call, it will never get the audio focus in the first place. So playback is permanently paused. When adding an EventLogger
you can see that this is notified via onPlayWhenReadyChanged
with PLAY_WHEN_READY_CHANGE_REASON_AUDIO_FOCUS_LOSS
:
playWhenReady [eventTime=1.24, mediaPos=0.00, window=0, false, AUDIO_FOCUS_LOSS]
There is also a feature to ask for delayed focus gain in this particular case (so that playback continues automatically after the phone call), but this isn't implemented yet. Once that is done, you would indeed see a playback suppression reason change. Is this something you'd like to use? If so, we can mark this as a feature request.
Yes, please mark it as a feature request
Thanks, renamed the issue to reflect the feature request. See also [internal b/300916151] that tracks the same feature.
Version
Media3 main branch
More version details
No response
Devices that reproduce the issue
Pixel 3, Android 14
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Not tested
Reproduction steps
Expected result
The
player.getPlaybackSuppressionReason()
givesPLAYBACK_SUPPRESSION_REASON_NONE
even though the playback is suppressed due to audio focus loss.Actual result
The
player.getPlaybackSuppressionReason()
should givePLAYBACK_SUPPRESSION_REASON_TRANSIENT_AUDIO_FOCUS_LOSS
, since the playback is suppressed due to the phone call.Media
Not applicable
Bug Report
adb bugreport
to android-media-github@google.com after filing this issue.