mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
make time updates work for .mpv and .avp
- time update notifications work for both backends - only init mpv timers when mpv is the active backend - move notification extension to playerbackend
This commit is contained in:
@@ -116,6 +116,10 @@ final class AVPlayerBackend: PlayerBackend {
|
||||
#endif
|
||||
}
|
||||
|
||||
deinit {
|
||||
NotificationCenter.default.removeObserver(self, name: .getTimeUpdatesNotification, object: self.currentTime)
|
||||
}
|
||||
|
||||
func bestPlayable(_ streams: [Stream], maxResolution: ResolutionSetting) -> Stream? {
|
||||
let sortedByResolution = streams
|
||||
.filter { ($0.kind == .adaptive || $0.kind == .stream) && $0.resolution <= maxResolution.value }
|
||||
@@ -596,6 +600,8 @@ final class AVPlayerBackend: PlayerBackend {
|
||||
if self.controlsUpdates {
|
||||
self.updateControls()
|
||||
}
|
||||
|
||||
NotificationCenter.default.post(name: .getTimeUpdatesNotification, object: self.currentTime)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user