-
Notifications
You must be signed in to change notification settings - Fork 575
Closed
Closed
Copy link
Labels
Description
Version
Media3 1.3.0
More version details
No response
Devices that reproduce the issue
- Android 5.1 emulator
- Android 7.1 emulator
- Android 13 Pixel 7a
- Android 14 emulator
Devices that do not reproduce the issue
N/A
Reproducible in the demo app?
Yes
Reproduction steps
Example:
- Add one song to playlist in demo app
- Play the song
- When the song ended and player state is STATE_ENDED, remove the app from recents
- Notice stale notification
Expected result
No stale notification (like if you pause instead of waiting for ended)
Actual result
Stale notification
This is caused by
media/demos/session_service/src/main/java/androidx/media3/demo/session/DemoPlaybackService.kt
Lines 93 to 96 in d13a0f4
override fun onTaskRemoved(rootIntent: Intent?) { | |
val player = mediaLibrarySession.player | |
if (!player.playWhenReady || player.mediaItemCount == 0) { | |
stopSelf() |
player.playbackState == Player.STATE_ENDED ||
to the condition has helped fix this in my app.
I believe https://developer.android.com/media/media3/session/background-playback should be updated as well.
Thank you.
Media
N/A
Bug Report
- You will email the zip file produced by
adb bugreport
to android-media-github@google.com after filing this issue.