Commit da290b51 authored by Nicolas Pomepuy's avatar Nicolas Pomepuy

Audio: improve resume playback after killing the app

Fixes #1603
parent 03d39953
Pipeline #56129 passed with stage
in 18 minutes and 2 seconds
......@@ -821,7 +821,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
loadMediaMeta(mw)
mw.length = player.getLength()
saveMediaList()
savePosition(reset = true)
savePosition()
saveCurrentMedia()
newMedia = false
if (player.hasRenderer || !player.isVideoPlaying()) showAudioPlayer.value = true
......@@ -856,6 +856,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
abRepeat.value?.let {
if (it.stop != -1L && player.getCurrentTime() > it.stop) player.seek(it.start)
}
if (player.getCurrentTime() % 10 == 0L) savePosition()
}
MediaPlayer.Event.SeekableChanged -> if (event.seekable && settings.getBoolean(KEY_PLAYBACK_SPEED_PERSIST, false)) {
player.setRate(settings.getFloat(KEY_PLAYBACK_RATE, 1.0f), false)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment