mirror of
https://github.com/yattee/yattee.git
synced 2024-12-13 05:40:32 +05:30
25 lines
650 B
Swift
25 lines
650 B
Swift
import AVKit
|
|
import SwiftUI
|
|
|
|
final class PlayerViewController: NSViewController {
|
|
var playerModel: PlayerModel!
|
|
var playerView = AVPlayerView()
|
|
var pictureInPictureDelegate = PictureInPictureDelegate()
|
|
|
|
override func viewDidDisappear() {
|
|
super.viewDidDisappear()
|
|
}
|
|
|
|
override func loadView() {
|
|
playerView.player = playerModel.player
|
|
pictureInPictureDelegate.playerModel = playerModel
|
|
|
|
playerView.allowsPictureInPicturePlayback = true
|
|
playerView.showsFullScreenToggleButton = true
|
|
|
|
playerView.pictureInPictureDelegate = pictureInPictureDelegate
|
|
|
|
view = playerView
|
|
}
|
|
}
|