mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-08-29 22:57:16 +02:00
@@ -138,19 +138,21 @@ class MediaSessionCallback(var playerNotificationService:PlayerNotificationServi
|
|||||||
|
|
||||||
Log.d(tag, "handleCallMediaButton keyEvent = $keyEvent | action ${keyEvent?.action}")
|
Log.d(tag, "handleCallMediaButton keyEvent = $keyEvent | action ${keyEvent?.action}")
|
||||||
|
|
||||||
if (keyEvent?.action == KeyEvent.ACTION_DOWN) {
|
// TODO: Widget was only sending this event on key down
|
||||||
Log.d(tag, "handleCallMediaButton: key action_down for ${keyEvent.keyCode}")
|
// but this cannot be defined in both key down and key up
|
||||||
when (keyEvent.keyCode) {
|
// if (keyEvent?.action == KeyEvent.ACTION_DOWN) {
|
||||||
KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE -> {
|
// Log.d(tag, "handleCallMediaButton: key action_down for ${keyEvent.keyCode}")
|
||||||
Log.d(tag, "handleCallMediaButton: Media Play/Pause")
|
// when (keyEvent.keyCode) {
|
||||||
if (playerNotificationService.mPlayer.isPlaying) {
|
// KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE -> {
|
||||||
playerNotificationService.pause()
|
// Log.d(tag, "handleCallMediaButton: Media Play/Pause")
|
||||||
} else {
|
// if (playerNotificationService.mPlayer.isPlaying) {
|
||||||
playerNotificationService.play()
|
// playerNotificationService.pause()
|
||||||
}
|
// } else {
|
||||||
}
|
// playerNotificationService.play()
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
if (keyEvent?.action == KeyEvent.ACTION_UP) {
|
if (keyEvent?.action == KeyEvent.ACTION_UP) {
|
||||||
Log.d(tag, "handleCallMediaButton: key action_up for ${keyEvent.keyCode}")
|
Log.d(tag, "handleCallMediaButton: key action_up for ${keyEvent.keyCode}")
|
||||||
|
|||||||
Reference in New Issue
Block a user