mirror of
https://github.com/yattee/yattee.git
synced 2024-12-13 22:00:31 +05:30
24 lines
609 B
Swift
24 lines
609 B
Swift
import Defaults
|
|
import SwiftUI
|
|
|
|
struct Player: NSViewControllerRepresentable {
|
|
var video: Video!
|
|
|
|
@EnvironmentObject<InvidiousAPI> private var api
|
|
@EnvironmentObject<PlaybackModel> private var playback
|
|
|
|
func makeNSViewController(context _: Context) -> PlayerViewController {
|
|
let controller = PlayerViewController()
|
|
|
|
controller.video = video
|
|
controller.playback = playback
|
|
controller.api = api
|
|
|
|
controller.resolution = Defaults[.quality]
|
|
|
|
return controller
|
|
}
|
|
|
|
func updateNSViewController(_: PlayerViewController, context _: Context) {}
|
|
}
|