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)
playerModel.avPlayerViewController = playerViewController
playerViewController.customInfoViewControllers = [
infoViewController([.comments], title: "Comments"),
var infoViewControllers = [UIHostingController<AnyView>]()
if CommentsModel.enabled {
infoViewControllers.append(infoViewController([.comments], title: "Comments"))
}
infoViewControllers.append(contentsOf: [
infoViewController([.related], title: "Related"),
infoViewController([.playingNext, .playedPreviously], title: "Playing Next")
]
])
playerViewController.customInfoViewControllers = infoViewControllers
#else
embedViewController()
#endif