mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 21:43:41 +00:00
22 lines
485 B
Swift
22 lines
485 B
Swift
import AVKit
|
|
import SwiftUI
|
|
|
|
final class PlayerViewController: NSViewController {
|
|
var playerModel: PlayerModel!
|
|
var playerView = AVPlayerView()
|
|
|
|
override func viewDidDisappear() {
|
|
playerModel.pause()
|
|
super.viewDidDisappear()
|
|
}
|
|
|
|
override func loadView() {
|
|
playerView.player = playerModel.player
|
|
|
|
playerView.allowsPictureInPicturePlayback = true
|
|
playerView.showsFullScreenToggleButton = true
|
|
|
|
view = playerView
|
|
}
|
|
}
|