Fix regression that caused the song duration to not be updated in PlayerState

This commit is contained in:
vfsfitvnm 2022-06-26 22:52:07 +02:00
parent 5c8dd45c2a
commit 3607b041b2

View file

@ -50,6 +50,7 @@ open class PlayerState(private val player: Player) : Player.Listener {
init {
handler.post(object : Runnable {
override fun run() {
duration = player.duration
currentPosition = player.currentPosition
handler.postDelayed(this, 500)
}
@ -61,7 +62,6 @@ open class PlayerState(private val player: Player) : Player.Listener {
}
override fun onPlaybackStateChanged(playbackState: Int) {
duration = player.duration
this.playbackState = playbackState
}