Unverified Commit 8119cede authored by Hampton Maxwell's avatar Hampton Maxwell Committed by GitHub
Browse files

Merge pull request #1304 from nfb-onf/disable_airplay_for_sideloaded_captions

disable airplay when sideloaded captions
parents e1c1eb6d 06b5d50f
Loading
Loading
Loading
Loading
+2 −0
Changes for README.md: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -656,6 +656,8 @@ uri | URL for the text track. Currently, only tracks hosted on a webserver are s

On iOS, sidecar text tracks are only supported for individual files, not HLS playlists. For HLS, you should include the text tracks as part of the playlist.

Note: Due to iOS limitations, sidecar text tracks are not compatible with Airplay. If textTracks are specified, AirPlay support will be automatically disabled.

Example:
```
import { TextTrackType }, Video from 'react-native-video';
+4 −1
Changes for ios/Video/RCTVideo.m: 4 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -401,11 +401,14 @@ 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];