no need for NotificationCenter

This commit is contained in:
Toni Förster
2023-12-05 00:07:36 +01:00
parent 4ca8adc4dd
commit 721a97dc41
4 changed files with 4 additions and 24 deletions

View File

@@ -116,10 +116,6 @@ 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 }
@@ -601,7 +597,7 @@ final class AVPlayerBackend: PlayerBackend {
self.updateControls()
}
NotificationCenter.default.post(name: .getTimeUpdatesNotification, object: self.currentTime)
self.model.updateTime(self.currentTime!)
}
}