I\'ve created my own video player using AVPlayer and have gotten everything to work properly except for closed captions. I have a video I\'m testing and I know for a fact the cl
Yes.
This is the right way :
let group = self.player!.currentItem!.asset.mediaSelectionGroupForMediaCharacteristic(AVMediaCharacteristicLegible)
self.player?.currentItem?.selectMediaOption(nil, inMediaSelectionGroup: group!)
I disable subtitle by below code snippet
let output = AVPlayerItemLegibleOutput.init()
output.setDelegate(self, queue:DispatchQueue.main)
output.suppressesPlayerRendering = true
playerItem?.add(output)
You can check suppressesPlayerRendering api there
This works MACaptionAppearanceSetDisplayType(kMACaptionAppearanceDomainUser, kMACaptionAppearanceDisplayTypeForcedOnly);
My first thought would be to go to Subtitles & Captioning (Settings -> General -> Accessibility -> Subtitles & Captioning Setting) and ensure that ‘Closed Captions + SDH’ is turned off. Even if you set closedCaptionDisplayEnabled to NO, this setting will override it.
You can test if this is enabled on a device within your code using UIAccessibilityIsClosedCaptioningEnabled() which will return a BOOL that is true if it is. However, this setting can not be change within an app.