diff --git a/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java b/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java index 04c4bb2c..3d4702fb 100644 --- a/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java +++ b/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java @@ -520,9 +520,9 @@ class ReactExoplayerView extends FrameLayout implements Format format = groups.get(i).getFormat(0); WritableMap textTrack = Arguments.createMap(); textTrack.putInt("index", i); - textTrack.putString("title", format.id); + textTrack.putString("title", format.id != null ? format.id : ""); textTrack.putString("type", format.sampleMimeType); - textTrack.putString("language", format.language); + textTrack.putString("language", format.language != null ? format.language : ""); textTracks.pushMap(textTrack); } return textTracks; diff --git a/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerViewManager.java b/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerViewManager.java index e204a4e7..7c41db58 100644 --- a/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerViewManager.java +++ b/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerViewManager.java @@ -126,10 +126,14 @@ public class ReactExoplayerViewManager extends ViewGroupManager 0) { + title = [values objectAtIndex:0]; + } + NSString *language = [currentOption extendedLanguageTag] ? [currentOption extendedLanguageTag] : @""; NSDictionary *textTrack = @{ @"index": [NSNumber numberWithInt:i], @"title": title, - @"language": [currentOption extendedLanguageTag] + @"language": language }; [textTracks addObject:textTrack]; }