mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-09-09 19:31:51 +02:00
Pause instead of close playback on KEYCODE_MEDIA_STOP (#1913)
Car head units send KEYCODE_MEDIA_STOP when powering off, which was calling closePlayback() and destroying the session entirely. This removed the media notification from the shade and required manually reopening the app to resume listening. Change to pause() so the session and notification stay alive, matching the behavior of YouTube, Plex, and Jellyfin. When the car powers back on and sends KEYCODE_MEDIA_PLAY, playback resumes in the same session.
This commit is contained in:
@@ -234,7 +234,7 @@ class MediaSessionCallback(var playerNotificationService:PlayerNotificationServi
|
||||
playerNotificationService.jumpBackward()
|
||||
}
|
||||
KeyEvent.KEYCODE_MEDIA_STOP -> {
|
||||
playerNotificationService.closePlayback()
|
||||
playerNotificationService.pause()
|
||||
}
|
||||
else -> {
|
||||
Log.d(tag, "KeyCode:${keyEvent.keyCode}")
|
||||
|
||||
Reference in New Issue
Block a user