2021-07-19 04:02:46 +05:30
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
struct Player: NSViewControllerRepresentable {
|
2021-08-24 03:01:51 +05:30
|
|
|
@EnvironmentObject<PlaybackState> private var playbackState
|
|
|
|
|
2021-07-19 04:02:46 +05:30
|
|
|
var video: Video!
|
|
|
|
|
|
|
|
func makeNSViewController(context _: Context) -> PlayerViewController {
|
|
|
|
let controller = PlayerViewController()
|
2021-08-23 00:43:33 +05:30
|
|
|
|
2021-07-19 04:02:46 +05:30
|
|
|
controller.video = video
|
2021-08-24 03:01:51 +05:30
|
|
|
controller.playbackState = playbackState
|
2021-07-19 04:02:46 +05:30
|
|
|
|
|
|
|
return controller
|
|
|
|
}
|
|
|
|
|
|
|
|
func updateNSViewController(_: PlayerViewController, context _: Context) {}
|
|
|
|
}
|