Hi,
we use AVPlayer for playing back HLS streams and we have an issue with Closed Captions.
The Captions are shown correctly when we test the player on simulators (tried with iOS 8.1, 9, 10.1) but nothing is shown when we run it on the device (tried with iOS 9.3, 10.1).
This is a stream that shows the issue: http://demo.cf.castlabs.com/media/HLS/CC-HLS/hls.m3u8
When subtitles are defined as external WebVTT files, everything works fine, as in this stream:
https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_16x9/bipbop_16x9_variant.m3u8
This is a snippet of our subtitles selection code
- (void)selectSubtitleOption:(NSInteger)index {
AVMediaSelectionGroup subtitleSelectionGroup = [playerItem.asset mediaSelectionGroupForMediaCharacteristic:AVMediaCharacteristicLegible];
if (subtitleSelectionGroup) {
NSUInteger count = subtitleSelectionGroup.options.count;
if (index < count) {
AVMediaSelectionOption* option = [subtitleSelectionGroup.options objectAtIndex:index];
[playerItem selectMediaOption:option inMediaSelectionGroup:subtitleSelectionGroup];
}
}
}
We also tried to:
- set
to trueclosedCaptionDisplayEnabled
- enabled Closed Captions+SDH in Settings/General/Accessibility/Subtitles&Captioning of the Devices
Any idea?