Skip to content

Commit

Permalink
Merge pull request #32 from DiceTechnology/fix/audio-text-null-checks
Browse files Browse the repository at this point in the history
fix: adding null checks and renaming isoCode and url
  • Loading branch information
Vince Dimitrov authored Apr 25, 2019
2 parents 5058c9a + b2529aa commit 5868378
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 5868378

Please sign in to comment.