I'm creating custom video player, and i want to create toggle button for CC.
I saw this post : IOS AVPlayer cannot disable closed captions
So I tried :
AVMediaSelectionGroup *group = [self.avPlayer.currentItem.asset mediaSelectionGroupForMediaCharacteristic:AVMediaCharacteristicLegible];
[self.avPlayer.currentItem selectMediaOption:nil inMediaSelectionGroup:group];
Didn't work.. cc still visible.
also tried :
AVPlayerItemLegibleOutput *output = [[AVPlayerItemLegibleOutput alloc] init];
[output setDelegate:self queue:dispatch_get_main_queue()];
[output setSuppressesPlayerRendering:true];
[self.avPlayer.currentItem addOutput:output];
It's hide the the cc, but how can I unhide them? ,I tried:
[output setSuppressesPlayerRendering:true];
but the cc freeze on the screen.
thanks!