mirror of
https://github.com/yattee/yattee.git
synced 2025-08-06 10:44:06 +00:00
Model improvements
This commit is contained in:
@@ -5,6 +5,8 @@ import Foundation
|
||||
import SwiftUI
|
||||
|
||||
final class PlayerControlsModel: ObservableObject {
|
||||
static var shared = PlayerControlsModel()
|
||||
|
||||
@Published var isLoadingVideo = false
|
||||
@Published var isPlaying = true
|
||||
@Published var presentingControls = false { didSet { handlePresentationChange() } }
|
||||
@@ -33,7 +35,7 @@ final class PlayerControlsModel: ObservableObject {
|
||||
self.presentingControlsOverlay = presentingControlsOverlay
|
||||
self.presentingDetailsOverlay = presentingDetailsOverlay
|
||||
self.timer = timer
|
||||
self.player = player
|
||||
self.player = player ?? .shared
|
||||
}
|
||||
|
||||
func handlePresentationChange() {
|
||||
@@ -130,8 +132,4 @@ final class PlayerControlsModel: ObservableObject {
|
||||
timer?.invalidate()
|
||||
timer = nil
|
||||
}
|
||||
|
||||
func update() {
|
||||
player?.backend.updateControls()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user