minor player fixes
* fix exoplayer access on wrong thread * fix remaining time calculation sometimes failed
This commit is contained in:
parent
b3ce43c614
commit
6bec0512ba
|
@ -194,10 +194,11 @@ class PlayerActivity : AppCompatActivity() {
|
|||
var btnNextEpIsVisible: Boolean
|
||||
var controlsVisible: Boolean
|
||||
|
||||
remainingTime = model.player.duration - model.player.currentPosition
|
||||
remainingTime = if (remainingTime < 0) 0 else remainingTime
|
||||
|
||||
withContext(Dispatchers.Main) {
|
||||
if (model.player.duration > 0) {
|
||||
remainingTime = model.player.duration - model.player.currentPosition
|
||||
remainingTime = if (remainingTime < 0) 0 else remainingTime
|
||||
}
|
||||
btnNextEpIsVisible = button_next_ep.isVisible
|
||||
controlsVisible = controller.isVisible
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue