import Defaults import SwiftUI struct AVPlayerView: UIViewControllerRepresentable { @EnvironmentObject private var comments @EnvironmentObject private var navigation @EnvironmentObject private var player @EnvironmentObject 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() } }