PiP and UI improvements

This commit is contained in:
Arkadiusz Fal
2021-10-28 19:14:55 +02:00
parent c387454d9a
commit 24f7c566bf
18 changed files with 169 additions and 55 deletions

View File

@@ -13,7 +13,8 @@ final class PlayerModel: ObservableObject {
let logger = Logger(label: "net.arekf.Pearvidious.ps")
private(set) var player = AVPlayer()
var controller: PlayerViewController?
private(set) var playerView = Player()
var controller: PlayerViewController? { didSet { playerView.controller = controller } }
#if os(tvOS)
var avPlayerViewController: AVPlayerViewController?
#endif
@@ -52,6 +53,8 @@ final class PlayerModel: ObservableObject {
private var timeObserverThrottle = Throttle(interval: 2)
var playingInPictureInPicture = false
init(accounts: AccountsModel? = nil, instances: InstancesModel? = nil) {
self.accounts = accounts ?? AccountsModel()
self.instances = instances ?? InstancesModel()