Merge pull request #1304 from nfb-onf/disable_airplay_for_sideloaded_captions

disable airplay when sideloaded captions
This commit is contained in:
Hampton Maxwell
2018-12-05 17:37:22 -08:00
committed by GitHub
2 changed files with 6 additions and 1 deletions

View File

@@ -401,10 +401,13 @@ static int const RCTVideoUnset = -1;
- (void)playerItemPrepareText:(AVAsset *)asset assetOptions:(NSDictionary * __nullable)assetOptions withCallback:(void(^)(AVPlayerItem *))handler
{
if (!_textTracks) {
if (!_textTracks || _textTracks.count==0) {
handler([AVPlayerItem playerItemWithAsset:asset]);
return;
}
// AVPlayer can't airplay AVMutableCompositions
_allowsExternalPlayback = NO;
// sideload text tracks
AVMutableComposition *mixComposition = [[AVMutableComposition alloc] init];