yattee/macOS/Player.swift

24 lines
609 B
Swift
Raw Normal View History

2021-09-25 08:18:22 +00:00
import Defaults
2021-07-18 22:32:46 +00:00
import SwiftUI
struct Player: NSViewControllerRepresentable {
var video: Video!
2021-09-25 08:18:22 +00:00
@EnvironmentObject<InvidiousAPI> private var api
@EnvironmentObject<PlaybackModel> private var playback
2021-07-18 22:32:46 +00:00
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-09-25 08:18:22 +00:00
controller.playback = playback
controller.api = api
controller.resolution = Defaults[.quality]
2021-07-18 22:32:46 +00:00
return controller
}
func updateNSViewController(_: PlayerViewController, context _: Context) {}
}