Hello, mpv! 🎉

This commit is contained in:
Arkadiusz Fal
2022-02-16 21:23:11 +01:00
parent 48ab8b27c8
commit 0a36870480
75 changed files with 6516 additions and 932 deletions

View File

@@ -0,0 +1,25 @@
import Defaults
import SwiftUI
struct AVPlayerView: UIViewControllerRepresentable {
@EnvironmentObject<CommentsModel> private var comments
@EnvironmentObject<NavigationModel> private var navigation
@EnvironmentObject<PlayerModel> private var player
@EnvironmentObject<SubscriptionsModel> private var subscriptions
func makeUIViewController(context _: Context) -> UIViewController {
let controller = AppleAVPlayerViewController()
controller.commentsModel = comments
controller.navigationModel = navigation
controller.playerModel = player
controller.subscriptionsModel = subscriptions
player.avPlayerBackend.controller = controller
return controller
}
func updateUIViewController(_: UIViewController, context _: Context) {
player.rebuildTVMenu()
}
}