Fix disabling comments on tvOS

This commit is contained in:
Arkadiusz Fal 2021-12-06 19:12:59 +01:00
parent eeb7b1f151
commit 8d9bbf647a

View File

@ -45,11 +45,16 @@ final class PlayerViewController: UIViewController {
#if os(tvOS) #if os(tvOS)
playerModel.avPlayerViewController = playerViewController playerModel.avPlayerViewController = playerViewController
playerViewController.customInfoViewControllers = [ var infoViewControllers = [UIHostingController<AnyView>]()
infoViewController([.comments], title: "Comments"), if CommentsModel.enabled {
infoViewControllers.append(infoViewController([.comments], title: "Comments"))
}
infoViewControllers.append(contentsOf: [
infoViewController([.related], title: "Related"), infoViewController([.related], title: "Related"),
infoViewController([.playingNext, .playedPreviously], title: "Playing Next") infoViewController([.playingNext, .playedPreviously], title: "Playing Next")
] ])
playerViewController.customInfoViewControllers = infoViewControllers
#else #else
embedViewController() embedViewController()
#endif #endif