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() {
|
2021-10-05 20:20:09 +00:00
|
|
|
// 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
|
|
|
|
}
|
|
|
|
}
|