Loading README.md +3 −5 Changes for README.md: 3 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ yarn add react-native-video <details> <summary>iOS</summary> Run `react-native link` to link the react-native-video library. Run `react-native link react-native-video` to link the react-native-video library. If you would like to allow other apps to play music over your video component, add: Loading Loading @@ -79,9 +79,7 @@ end <details> <summary>tvOS</summary> Run `react-native link` to link the react-native-video library. `react-native link` doesn’t work properly with the tvOS target so we need to add the library manually. `react-native link react-native-video` doesn’t work properly with the tvOS target so we need to add the library manually. First select your project in Xcode. Loading @@ -103,7 +101,7 @@ Select RCTVideo-tvOS <details> <summary>Android</summary> Run `react-native link` to link the react-native-video library. Run `react-native link react-native-video` to link the react-native-video library. Or if you have trouble, make the following additions to the given files manually: Loading ios/Video/RCTVideo.m +9 −9 Changes for ios/Video/RCTVideo.m: 9 added lines, 9 removed lines. Original line number Diff line number Diff line Loading @@ -13,6 +13,8 @@ static NSString *const readyForDisplayKeyPath = @"readyForDisplay"; static NSString *const playbackRate = @"rate"; static NSString *const timedMetadata = @"timedMetadata"; static int const RCTVideoUnset = -1; @implementation RCTVideo { AVPlayer *_player; Loading Loading @@ -848,7 +850,7 @@ static NSString *const timedMetadata = @"timedMetadata"; } } int selectedTrackIndex = -1; int selectedTrackIndex = RCTVideoUnset; if ([type isEqualToString:@"disabled"]) { // Do nothing. We want to ensure option is nil Loading Loading @@ -877,16 +879,11 @@ static NSString *const timedMetadata = @"timedMetadata"; selectedTrackIndex = index; } } } // user's selected language might not be available, or system defaults have captions enabled if (selectedTrackIndex == -1 || [type isEqualToString:@"default"]) { } else { // type "system" CFArrayRef captioningMediaCharacteristics = MACaptionAppearanceCopyPreferredCaptioningMediaCharacteristics(kMACaptionAppearanceDomainUser); NSArray *captionSettings = (__bridge NSArray*)captioningMediaCharacteristics; if ([captionSettings containsObject:AVMediaCharacteristicTranscribesSpokenDialogForAccessibility]) { // iterate through the textTracks to find a matching option, or default to the first object. selectedTrackIndex = 0; selectedTrackIndex = 0; // If we can't find a match, use the first available track NSString *systemLanguage = [[NSLocale preferredLanguages] firstObject]; for (int i = 0; i < textTracks.count; ++i) { NSDictionary *currentTextTrack = [textTracks objectAtIndex:i]; Loading @@ -899,7 +896,10 @@ static NSString *const timedMetadata = @"timedMetadata"; } for (int i = firstTextIndex; i < _player.currentItem.tracks.count; ++i) { BOOL isEnabled = i == selectedTrackIndex + firstTextIndex; BOOL isEnabled = NO; if (selectedTrackIndex != RCTVideoUnset) { isEnabled = i == selectedTrackIndex + firstTextIndex; } [_player.currentItem.tracks[i] setEnabled:isEnabled]; } } Loading Loading
README.md +3 −5 Changes for README.md: 3 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ yarn add react-native-video <details> <summary>iOS</summary> Run `react-native link` to link the react-native-video library. Run `react-native link react-native-video` to link the react-native-video library. If you would like to allow other apps to play music over your video component, add: Loading Loading @@ -79,9 +79,7 @@ end <details> <summary>tvOS</summary> Run `react-native link` to link the react-native-video library. `react-native link` doesn’t work properly with the tvOS target so we need to add the library manually. `react-native link react-native-video` doesn’t work properly with the tvOS target so we need to add the library manually. First select your project in Xcode. Loading @@ -103,7 +101,7 @@ Select RCTVideo-tvOS <details> <summary>Android</summary> Run `react-native link` to link the react-native-video library. Run `react-native link react-native-video` to link the react-native-video library. Or if you have trouble, make the following additions to the given files manually: Loading
ios/Video/RCTVideo.m +9 −9 Changes for ios/Video/RCTVideo.m: 9 added lines, 9 removed lines. Original line number Diff line number Diff line Loading @@ -13,6 +13,8 @@ static NSString *const readyForDisplayKeyPath = @"readyForDisplay"; static NSString *const playbackRate = @"rate"; static NSString *const timedMetadata = @"timedMetadata"; static int const RCTVideoUnset = -1; @implementation RCTVideo { AVPlayer *_player; Loading Loading @@ -848,7 +850,7 @@ static NSString *const timedMetadata = @"timedMetadata"; } } int selectedTrackIndex = -1; int selectedTrackIndex = RCTVideoUnset; if ([type isEqualToString:@"disabled"]) { // Do nothing. We want to ensure option is nil Loading Loading @@ -877,16 +879,11 @@ static NSString *const timedMetadata = @"timedMetadata"; selectedTrackIndex = index; } } } // user's selected language might not be available, or system defaults have captions enabled if (selectedTrackIndex == -1 || [type isEqualToString:@"default"]) { } else { // type "system" CFArrayRef captioningMediaCharacteristics = MACaptionAppearanceCopyPreferredCaptioningMediaCharacteristics(kMACaptionAppearanceDomainUser); NSArray *captionSettings = (__bridge NSArray*)captioningMediaCharacteristics; if ([captionSettings containsObject:AVMediaCharacteristicTranscribesSpokenDialogForAccessibility]) { // iterate through the textTracks to find a matching option, or default to the first object. selectedTrackIndex = 0; selectedTrackIndex = 0; // If we can't find a match, use the first available track NSString *systemLanguage = [[NSLocale preferredLanguages] firstObject]; for (int i = 0; i < textTracks.count; ++i) { NSDictionary *currentTextTrack = [textTracks objectAtIndex:i]; Loading @@ -899,7 +896,10 @@ static NSString *const timedMetadata = @"timedMetadata"; } for (int i = firstTextIndex; i < _player.currentItem.tracks.count; ++i) { BOOL isEnabled = i == selectedTrackIndex + firstTextIndex; BOOL isEnabled = NO; if (selectedTrackIndex != RCTVideoUnset) { isEnabled = i == selectedTrackIndex + firstTextIndex; } [_player.currentItem.tracks[i] setEnabled:isEnabled]; } } Loading