Reputation: 9
I need to show which closed captions option is active in our .Net 8 tvOS app by highlighting the selected option in the UI, but I am only able to do this for certain videos. If the embedded captions specify the language, then the display name for the AVMediaSelectionOption is "English CC". If the embedded captions do not specify the language, then the locale value is null and the display name is just "CC". However, AVPlayerViewController's transport bar item for captions does not update to show the current AVPlayerItem's available AVMediaSelectionOptions. So if I call playerItem.SelectMediaOption(option, group) on a video that does not specify a language in the embedded captions, it can't highlight the selected option because it is not present in the UI. Is there a way to force the list to update and show the current item's available AVMediaSelectionOptions?
As of right now, I have an observer set up on AVPlayer's timeControlStatus property. When a new video starts playing I fetch the AVMediaSelectionOption for the current video and select it. This works just fine if the new video's available option matches what is already in the captions list in the UI.
Upvotes: 0
Views: 35