From b850b31f0407752c3cc24d79883cebf7040acd61 Mon Sep 17 00:00:00 2001 From: Hampton Maxwell Date: Wed, 20 Jun 2018 15:46:04 -0700 Subject: [PATCH] Return empty string instead of null if text track title or language are not set --- .../java/com/brentvatne/exoplayer/ReactExoplayerView.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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;