yattee/macOS/PlayerViewController.swift

22 lines
502 B
Swift
Raw Normal View History

2021-07-18 22:32:46 +00:00
import AVKit
import SwiftUI
final class PlayerViewController: NSViewController {
2021-09-25 08:18:22 +00:00
var playerModel: PlayerModel!
2021-07-18 22:32:46 +00:00
var playerView = AVPlayerView()
override func viewDidDisappear() {
// TODO: pause on disappear settings
2021-07-18 22:32:46 +00:00
super.viewDidDisappear()
}
override func loadView() {
2021-09-25 08:18:22 +00:00
playerView.player = playerModel.player
2021-07-18 22:32:46 +00:00
2021-08-17 22:00:53 +00:00
playerView.allowsPictureInPicturePlayback = true
2021-07-18 22:32:46 +00:00
playerView.showsFullScreenToggleButton = true
view = playerView
}
}