mirror of
https://github.com/zoriya/react-native-omni.git
synced 2026-08-05 05:36:17 +00:00
Fix loading state
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user