mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
subscribe chapters to currentTime notification
This commit is contained in:
@@ -191,6 +191,10 @@ final class MPVBackend: PlayerBackend {
|
||||
}
|
||||
}
|
||||
|
||||
deinit {
|
||||
NotificationCenter.default.removeObserver(self, name: .getTimeUpdatesNotification, object: self.currentTime)
|
||||
}
|
||||
|
||||
typealias AreInIncreasingOrder = (Stream, Stream) -> Bool
|
||||
|
||||
func bestPlayable(_ streams: [Stream], maxResolution: ResolutionSetting) -> Stream? {
|
||||
@@ -432,6 +436,8 @@ final class MPVBackend: PlayerBackend {
|
||||
timeObserverThrottle.execute {
|
||||
self.model.updateWatch(time: self.currentTime)
|
||||
}
|
||||
|
||||
NotificationCenter.default.post(name: .getTimeUpdatesNotification, object: self.currentTime)
|
||||
}
|
||||
|
||||
private func stopClientUpdates() {
|
||||
@@ -618,3 +624,7 @@ final class MPVBackend: PlayerBackend {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension Notification.Name {
|
||||
static let getTimeUpdatesNotification = Notification.Name("getTimeUpdatesNotification")
|
||||
}
|
||||
|
Reference in New Issue
Block a user