Fixed skipping tracks on playback error. The faulty track is now removed from the queue.

This commit is contained in:
Antoine POPINEAU 2020-06-10 11:38:57 +02:00
parent 97b7dc2a61
commit 54f911793a
No known key found for this signature in database
GPG Key ID: A78AC64694F84063
1 changed files with 4 additions and 2 deletions

View File

@ -396,8 +396,10 @@ class PlayerService : Service() {
override fun onPlayerError(error: ExoPlaybackException?) {
EventBus.send(Event.PlaybackError(getString(R.string.error_playback)))
player.next()
player.playWhenReady = true
queue.current()?.let {
queue.remove(it)
player.prepare(queue.datasources)
}
}
}