Skip to content

Commit

Permalink
feat : 앱이 완전히 종료되면 Service를 종료시킨다.
Browse files Browse the repository at this point in the history
  • Loading branch information
HamBP committed Dec 7, 2023
1 parent 518ccca commit 73b9f59
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down

0 comments on commit 73b9f59

Please sign in to comment.