Loading ios/RCTVideo.m +10 −1 Changes for ios/RCTVideo.m: 10 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -411,6 +411,7 @@ static int const RCTVideoUnset = -1; atTime:kCMTimeZero error:nil]; NSMutableArray* validTextTracks = [NSMutableArray array]; for (int i = 0; i < _textTracks.count; ++i) { AVURLAsset *textURLAsset; NSString *textUri = [_textTracks objectAtIndex:i][@"uri"]; Loading @@ -420,6 +421,8 @@ static int const RCTVideoUnset = -1; textURLAsset = [AVURLAsset URLAssetWithURL:[self urlFilePath:textUri] options:nil]; } AVAssetTrack *textTrackAsset = [textURLAsset tracksWithMediaType:AVMediaTypeText].firstObject; if (!textTrackAsset) continue; // fix when there's no textTrackAsset [validTextTracks addObject:[_textTracks objectAtIndex:i]]; AVMutableCompositionTrack *textCompTrack = [mixComposition addMutableTrackWithMediaType:AVMediaTypeText preferredTrackID:kCMPersistentTrackID_Invalid]; Loading @@ -428,6 +431,9 @@ static int const RCTVideoUnset = -1; atTime:kCMTimeZero error:nil]; } if (validTextTracks.count != _textTracks.count) { [self setTextTracks:validTextTracks]; } return [AVPlayerItem playerItemWithAsset:mixComposition]; } Loading Loading @@ -848,7 +854,10 @@ static int const RCTVideoUnset = -1; selectedTrackIndex = index; } } } else { // type "system" } // in the situation that a selected text track is not available (eg. specifies a textTrack not available) if (![type isEqualToString:@"disabled"] && selectedTrackIndex == RCTVideoUnset) { CFArrayRef captioningMediaCharacteristics = MACaptionAppearanceCopyPreferredCaptioningMediaCharacteristics(kMACaptionAppearanceDomainUser); NSArray *captionSettings = (__bridge NSArray*)captioningMediaCharacteristics; if ([captionSettings containsObject:AVMediaCharacteristicTranscribesSpokenDialogForAccessibility]) { Loading Loading
ios/RCTVideo.m +10 −1 Changes for ios/RCTVideo.m: 10 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -411,6 +411,7 @@ static int const RCTVideoUnset = -1; atTime:kCMTimeZero error:nil]; NSMutableArray* validTextTracks = [NSMutableArray array]; for (int i = 0; i < _textTracks.count; ++i) { AVURLAsset *textURLAsset; NSString *textUri = [_textTracks objectAtIndex:i][@"uri"]; Loading @@ -420,6 +421,8 @@ static int const RCTVideoUnset = -1; textURLAsset = [AVURLAsset URLAssetWithURL:[self urlFilePath:textUri] options:nil]; } AVAssetTrack *textTrackAsset = [textURLAsset tracksWithMediaType:AVMediaTypeText].firstObject; if (!textTrackAsset) continue; // fix when there's no textTrackAsset [validTextTracks addObject:[_textTracks objectAtIndex:i]]; AVMutableCompositionTrack *textCompTrack = [mixComposition addMutableTrackWithMediaType:AVMediaTypeText preferredTrackID:kCMPersistentTrackID_Invalid]; Loading @@ -428,6 +431,9 @@ static int const RCTVideoUnset = -1; atTime:kCMTimeZero error:nil]; } if (validTextTracks.count != _textTracks.count) { [self setTextTracks:validTextTracks]; } return [AVPlayerItem playerItemWithAsset:mixComposition]; } Loading Loading @@ -848,7 +854,10 @@ static int const RCTVideoUnset = -1; selectedTrackIndex = index; } } } else { // type "system" } // in the situation that a selected text track is not available (eg. specifies a textTrack not available) if (![type isEqualToString:@"disabled"] && selectedTrackIndex == RCTVideoUnset) { CFArrayRef captioningMediaCharacteristics = MACaptionAppearanceCopyPreferredCaptioningMediaCharacteristics(kMACaptionAppearanceDomainUser); NSArray *captionSettings = (__bridge NSArray*)captioningMediaCharacteristics; if ([captionSettings containsObject:AVMediaCharacteristicTranscribesSpokenDialogForAccessibility]) { Loading