Fix loading state

This commit is contained in:
2026-04-20 22:35:59 +02:00
parent f1112bbc8f
commit 6fbee2e302
2 changed files with 4 additions and 4 deletions
@@ -44,11 +44,11 @@ class EventMap(private val player: MPVLib) : HybridOmniEventMapSpec(), MPVLib.Ev
}
private fun computePlayerStatus(): PlayerStatus {
val idle = player.getPropertyBoolean("core-idle") ?: false
val loading = player.getPropertyBoolean("paused-for-cache") ?: false
val idle = player.getPropertyBoolean("core-idle") ?: false
return when {
idle -> PlayerStatus.IDLE
loading -> PlayerStatus.LOADING
idle -> PlayerStatus.IDLE
else -> PlayerStatus.READYTOPLAY
}
}
@@ -89,11 +89,11 @@ class OmniPlayer : HybridOmniPlayerSpec() {
override val hasNext get() = source.metadata?.hasNext ?: false
override val status: PlayerStatus
get() {
val idle = player.getPropertyBoolean("core-idle") ?: false
val loading = player.getPropertyBoolean("paused-for-cache") ?: false
val idle = player.getPropertyBoolean("core-idle") ?: false
return when {
idle -> PlayerStatus.IDLE
loading -> PlayerStatus.LOADING
idle -> PlayerStatus.IDLE
else -> PlayerStatus.READYTOPLAY
}
}