From 7026ca7e51253673bb3ccdc4cfc6f5aada00d81f Mon Sep 17 00:00:00 2001 From: Ash Mishra Date: Thu, 18 Oct 2018 15:21:46 -0700 Subject: [PATCH 1/3] disable airplay when sideloaded captions --- ios/Video/RCTVideo.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ios/Video/RCTVideo.m b/ios/Video/RCTVideo.m index 61b87578..949bee0d 100644 --- a/ios/Video/RCTVideo.m +++ b/ios/Video/RCTVideo.m @@ -397,10 +397,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]; From 29826fc98f6715b7f7c66c6ff4f63b6d5cc7b7d0 Mon Sep 17 00:00:00 2001 From: Ash Mishra Date: Mon, 26 Nov 2018 10:16:19 -0800 Subject: [PATCH 2/3] readme update for disabled video on airplay --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 74438362..79d50610 100644 --- a/README.md +++ b/README.md @@ -603,6 +603,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 textTracks are not available for Airplay. If textTracks are specified for video that is airplayed, the visual content of the video is disabled (only audio will stream). + Example: ``` import { TextTrackType }, Video from 'react-native-video'; From 06b5d50f5ba6aa977268d567710a3ecc7bce66f3 Mon Sep 17 00:00:00 2001 From: Hampton Maxwell Date: Wed, 5 Dec 2018 17:36:35 -0800 Subject: [PATCH 3/3] Slightly clean up AirPlay / textTracks message --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 79d50610..9d19db44 100644 --- a/README.md +++ b/README.md @@ -603,7 +603,7 @@ 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 textTracks are not available for Airplay. If textTracks are specified for video that is airplayed, the visual content of the video is disabled (only audio will stream). +Note: Due to iOS limitations, sidecar text tracks are not compatible with Airplay. If textTracks are specified, AirPlay support will be automatically disabled. Example: ```