Fix regression that caused the song duration to not be updated in PlayerState
This commit is contained in:
@@ -50,6 +50,7 @@ open class PlayerState(private val player: Player) : Player.Listener {
|
|||||||
init {
|
init {
|
||||||
handler.post(object : Runnable {
|
handler.post(object : Runnable {
|
||||||
override fun run() {
|
override fun run() {
|
||||||
|
duration = player.duration
|
||||||
currentPosition = player.currentPosition
|
currentPosition = player.currentPosition
|
||||||
handler.postDelayed(this, 500)
|
handler.postDelayed(this, 500)
|
||||||
}
|
}
|
||||||
@@ -61,7 +62,6 @@ open class PlayerState(private val player: Player) : Player.Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onPlaybackStateChanged(playbackState: Int) {
|
override fun onPlaybackStateChanged(playbackState: Int) {
|
||||||
duration = player.duration
|
|
||||||
this.playbackState = playbackState
|
this.playbackState = playbackState
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user