diff --git a/android/app/src/main/java/com/ohdodok/catchytape/mediasession/PlaybackService.kt b/android/app/src/main/java/com/ohdodok/catchytape/mediasession/PlaybackService.kt index 4e9a851..59796f6 100644 --- a/android/app/src/main/java/com/ohdodok/catchytape/mediasession/PlaybackService.kt +++ b/android/app/src/main/java/com/ohdodok/catchytape/mediasession/PlaybackService.kt @@ -1,5 +1,6 @@ package com.ohdodok.catchytape.mediasession +import android.content.Intent import androidx.media3.exoplayer.ExoPlayer import androidx.media3.session.MediaSession import androidx.media3.session.MediaSessionService @@ -26,6 +27,11 @@ class PlaybackService : MediaSessionService() { super.onDestroy() } + override fun onTaskRemoved(rootIntent: Intent?) { + player.pause() + stopSelf() + } + override fun onGetSession( controllerInfo: MediaSession.ControllerInfo ): MediaSession? = mediaSession