diff --git a/ios/ReactVideoSubtitleSideloader/ReactVideoSubtitleSideloader/SubtitleTrack.swift b/ios/ReactVideoSubtitleSideloader/ReactVideoSubtitleSideloader/SubtitleTrack.swift index d5b1d9e84c..5cad4848e1 100644 --- a/ios/ReactVideoSubtitleSideloader/ReactVideoSubtitleSideloader/SubtitleTrack.swift +++ b/ios/ReactVideoSubtitleSideloader/ReactVideoSubtitleSideloader/SubtitleTrack.swift @@ -21,8 +21,8 @@ import Foundation } @objc public static func from(dict: NSDictionary) -> SubtitleTrack? { - guard let iso = dict["isoCode"] as? String, - let urlString = dict["url"] as? String, let url = URL(string: urlString) else { + guard let iso = dict["language"] as? String, + let urlString = dict["uri"] as? String, let url = URL(string: urlString) else { return nil } let name = diff --git a/ios/Video/RCTVideo.m b/ios/Video/RCTVideo.m index 8974526229..916bb09430 100644 --- a/ios/Video/RCTVideo.m +++ b/ios/Video/RCTVideo.m @@ -1244,12 +1244,14 @@ - (void)setMediaSelectionTrackForCharacteristic:(AVMediaCharacteristic)character } - (void)setSelectedAudioTrack:(NSDictionary *)selectedAudioTrack { + if (!selectedAudioTrack) return; _selectedAudioTrack = selectedAudioTrack; [self setMediaSelectionTrackForCharacteristic:AVMediaCharacteristicAudible withCriteria:_selectedAudioTrack]; } - (void)setSelectedTextTrack:(NSDictionary *)selectedTextTrack { + if (!selectedTextTrack) return; _selectedTextTrack = selectedTextTrack; if (_textTracks) { // sideloaded text tracks [self setSideloadedText];