1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-14 14:20:32 +05:30
yattee/macOS/Player.swift

24 lines
609 B
Swift
Raw Normal View History

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