mirror of
https://github.com/zoriya/react-native-omni.git
synced 2026-08-16 02:44:51 +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 {
|
private fun computePlayerStatus(): PlayerStatus {
|
||||||
val idle = player.getPropertyBoolean("core-idle") ?: false
|
|
||||||
val loading = player.getPropertyBoolean("paused-for-cache") ?: false
|
val loading = player.getPropertyBoolean("paused-for-cache") ?: false
|
||||||
|
val idle = player.getPropertyBoolean("core-idle") ?: false
|
||||||
return when {
|
return when {
|
||||||
idle -> PlayerStatus.IDLE
|
|
||||||
loading -> PlayerStatus.LOADING
|
loading -> PlayerStatus.LOADING
|
||||||
|
idle -> PlayerStatus.IDLE
|
||||||
else -> PlayerStatus.READYTOPLAY
|
else -> PlayerStatus.READYTOPLAY
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,11 +89,11 @@ class OmniPlayer : HybridOmniPlayerSpec() {
|
|||||||
override val hasNext get() = source.metadata?.hasNext ?: false
|
override val hasNext get() = source.metadata?.hasNext ?: false
|
||||||
override val status: PlayerStatus
|
override val status: PlayerStatus
|
||||||
get() {
|
get() {
|
||||||
val idle = player.getPropertyBoolean("core-idle") ?: false
|
|
||||||
val loading = player.getPropertyBoolean("paused-for-cache") ?: false
|
val loading = player.getPropertyBoolean("paused-for-cache") ?: false
|
||||||
|
val idle = player.getPropertyBoolean("core-idle") ?: false
|
||||||
return when {
|
return when {
|
||||||
idle -> PlayerStatus.IDLE
|
|
||||||
loading -> PlayerStatus.LOADING
|
loading -> PlayerStatus.LOADING
|
||||||
|
idle -> PlayerStatus.IDLE
|
||||||
else -> PlayerStatus.READYTOPLAY
|
else -> PlayerStatus.READYTOPLAY
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user