2021-07-18 22:32:46 +00:00
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
struct Player: NSViewControllerRepresentable {
|
2021-08-23 21:31:51 +00:00
|
|
|
@EnvironmentObject<PlaybackState> private var playbackState
|
|
|
|
|
2021-07-18 22:32:46 +00:00
|
|
|
var video: Video!
|
|
|
|
|
|
|
|
func makeNSViewController(context _: Context) -> PlayerViewController {
|
|
|
|
let controller = PlayerViewController()
|
2021-08-22 19:13:33 +00:00
|
|
|
|
2021-07-18 22:32:46 +00:00
|
|
|
controller.video = video
|
2021-08-23 21:31:51 +00:00
|
|
|
controller.playbackState = playbackState
|
2021-07-18 22:32:46 +00:00
|
|
|
|
|
|
|
return controller
|
|
|
|
}
|
|
|
|
|
|
|
|
func updateNSViewController(_: PlayerViewController, context _: Context) {}
|
|
|
|
}
|