I managed to display the subtitle track from AVPlayer on iOS 6, but I canβt configure it. It just shows the same style (small font size, white).
Here, as I select the subtitles:
AVMediaSelectionGroup *subtitle = [asset mediaSelectionGroupForMediaCharacteristic: AVMediaCharacteristicLegible]; [self.videoPlayer.currentItem selectMediaOption:subtitle.options[0] inMediaSelectionGroup: subtitle];
And how am I trying to adjust the subtitles:
AVTextStyleRule *rule = [[AVTextStyleRule alloc] initWithTextMarkupAttributes:@{ (id)kCMTextMarkupAttribute_ForegroundColorARGB : @[ @1, @1, @0, @0 ], (id) kCMTextMarkupAttribute_ItalicStyle : @(YES)}]; self.videoPlayer.currentItem.textStyleRules = @[rule];
Regardless of whether I place this fragment before or after selecting subtitles, the result will be the same.
AVPlayer is created with a local (file) URL (mp4 file).
Any thoughts on how to do this?
ios objective-c ios6 avplayer
Marcelo fabri
source share