Stop service on audio complete (android)

This commit is contained in:
Michael Speed 2024-03-23 15:27:23 +01:00
parent 812fb7a2e3
commit a5ac71d015

View File

@ -304,6 +304,9 @@ class AudioPlayerService : MediaSessionService(), Player.Listener, MeditoAudioSe
meditoAudioApi?.updatePlaybackState(state) {
if (primaryPlayer.playbackState != Player.STATE_ENDED) {
handler.postDelayed(this, 250)
} else {
stopForeground(STOP_FOREGROUND_REMOVE)
stopSelf()
}
}