2021-09-25 08:18:22 +00:00
|
|
|
import Defaults
|
2021-07-18 22:32:46 +00:00
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
struct Player: UIViewControllerRepresentable {
|
2021-09-25 08:18:22 +00:00
|
|
|
@EnvironmentObject<InvidiousAPI> private var api
|
|
|
|
@EnvironmentObject<PlaybackModel> private var playback
|
2021-08-23 21:31:51 +00:00
|
|
|
|
2021-07-18 22:32:46 +00:00
|
|
|
var video: Video?
|
|
|
|
|
|
|
|
func makeUIViewController(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 updateUIViewController(_: PlayerViewController, context _: Context) {}
|
|
|
|
}
|