Replace environment objects with observed objects

This commit is contained in:
Arkadiusz Fal
2022-11-24 21:36:05 +01:00
parent 23fa0968c6
commit 0d333b5583
102 changed files with 427 additions and 723 deletions

View File

@@ -312,7 +312,8 @@ final class MPVClient: ObservableObject {
}
DispatchQueue.main.async { [weak self] in
guard let self, let model = self.backend.model else { return }
guard let self else { return }
let model = self.backend.model
UIView.animate(withDuration: 0.2, animations: {
let aspectRatio = self.aspectRatio > 0 && self.aspectRatio < VideoPlayerView.defaultAspectRatio ? self.aspectRatio : VideoPlayerView.defaultAspectRatio
let height = [model.playerSize.height, model.playerSize.width / aspectRatio].min()!
@@ -329,7 +330,7 @@ final class MPVClient: ObservableObject {
self.glView?.queue.async {
self.glView.display()
}
self.backend?.controls?.objectWillChange.send()
self.backend?.controls.objectWillChange.send()
}
}
}