mirror of
https://github.com/yattee/yattee.git
synced 2025-01-08 22:07:10 +00:00
Handle core-idle property
This commit is contained in:
parent
b0db04c119
commit
9db5fb0de7
@ -605,6 +605,14 @@ final class MPVBackend: PlayerBackend {
|
|||||||
isPlaying = !paused
|
isPlaying = !paused
|
||||||
networkStateTimer.start()
|
networkStateTimer.start()
|
||||||
}
|
}
|
||||||
|
case "core-idle":
|
||||||
|
if let idle = UnsafePointer<Bool>(OpaquePointer(property.data))?.pointee {
|
||||||
|
if !idle {
|
||||||
|
isLoadingVideo = false
|
||||||
|
isSeeking = false
|
||||||
|
networkStateTimer.start()
|
||||||
|
}
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
logger.info("MPV backend received unhandled property: \(name)")
|
logger.info("MPV backend received unhandled property: \(name)")
|
||||||
}
|
}
|
||||||
|
@ -109,6 +109,7 @@ final class MPVClient: ObservableObject {
|
|||||||
|
|
||||||
mpv_set_wakeup_callback(mpv, wakeUp, UnsafeMutableRawPointer(Unmanaged.passUnretained(self).toOpaque()))
|
mpv_set_wakeup_callback(mpv, wakeUp, UnsafeMutableRawPointer(Unmanaged.passUnretained(self).toOpaque()))
|
||||||
mpv_observe_property(mpv, 0, "pause", MPV_FORMAT_FLAG)
|
mpv_observe_property(mpv, 0, "pause", MPV_FORMAT_FLAG)
|
||||||
|
mpv_observe_property(mpv, 0, "core-idle", MPV_FORMAT_FLAG)
|
||||||
}
|
}
|
||||||
|
|
||||||
func readEvents() {
|
func readEvents() {
|
||||||
|
Loading…
Reference in New Issue
Block a user