Skip to content

Commit

Permalink
Merge pull request #306 from boostcampwm2023/android/feature/123
Browse files Browse the repository at this point in the history
백그라운드에서 노래 재생 관리
  • Loading branch information
HamBP authored Dec 7, 2023
2 parents e548b62 + 73b9f59 commit 64ab5cf
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 64ab5cf

Please sign in to comment.