Hi guys,
Setting AVPlayerViewController.transportBarCustomMenuItems is not working on tvOS. I still see 2 icons for Audio and Subtitles.
let menuItemAudioAndSubtitles = UIMenu(
image: UIImage(systemName: "heart")
)
playerViewController.transportBarCustomMenuItems = [menuItemAudioAndSubtitles]
WWDC 2021 video is insufficient to make this work. https://developer.apple.com/videos/play/wwdc2021/10191/
The video doesn't say what exactly I need to do. Do I need to disable subtitle options?
viewController.allowedSubtitleOptionLanguages = []
This didn't work and I still see the default icon loaded by the player. Do I need to create subclass of AVPlayerViewController?
I just want to replace those 2 default icons by 1 icon as a test, but I was unsuccessful after many hours of work. Is it mandatory to define child menu items to the main item? Or do I perhaps need to define UIAction?
The documentation and video are insufficient in providing guidance how to do that. I did something like this before, but that was more than 3 years ago and audi and subtitles was showing at the top of the player screen as tabs, if I rememebr correctly.
Is transportBarCustomMenuItems perhaps deprecated? Is it possible that when loading AVPlayerItem and it detects audi and subtitles in the stream, it automatically resets AVPlayerViewController menu? How do I suppress this behavior?
I'm currently loading AVPlayerViewController into SwiftUI interface. Is that perhaps the problem? Should I write SwiftUI player overlay from scratch?
Thanks, Robert