Skip to content

Commit

Permalink
fix: adding null checks and renaming isoCode and url
Browse files Browse the repository at this point in the history
  • Loading branch information
Ventsislav Dimitrov committed Apr 25, 2019
1 parent 5058c9a commit b2529aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
2 changes: 2 additions & 0 deletions ios/Video/RCTVideo.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit b2529aa

Please sign in to comment.