Model improvements

This commit is contained in:
Arkadiusz Fal
2022-08-31 21:24:46 +02:00
parent b220f212df
commit 0d3ccc00ce
23 changed files with 190 additions and 133 deletions

View File

@@ -79,7 +79,7 @@ final class AVPlayerBackend: PlayerBackend {
init(model: PlayerModel, controls: PlayerControlsModel?, playerTime: PlayerTimeModel?) {
self.model = model
self.controls = controls
self.playerTime = playerTime
self.playerTime = playerTime ?? PlayerTimeModel.shared
addFrequentTimeObserver()
addInfrequentTimeObserver()
@@ -582,6 +582,7 @@ final class AVPlayerBackend: PlayerBackend {
}
if player.timeControlStatus == .playing {
self.model.objectWillChange.send()
if player.rate != self.model.currentRate {
player.rate = self.model.currentRate
}