From d47a6ed424245be6335f420dd09db985c260c3ab Mon Sep 17 00:00:00 2001 From: Hampton Maxwell Date: Tue, 12 Jun 2018 20:57:30 -0700 Subject: [PATCH] Specify the text track type without any conversion --- .../brentvatne/exoplayer/ReactExoplayerView.java | 13 +------------ 1 file changed, 1 insertion(+), 12 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 d659025e..04c4bb2c 100644 --- a/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java +++ b/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java @@ -307,18 +307,7 @@ class ReactExoplayerView extends FrameLayout implements } private MediaSource buildTextSource(String title, Uri uri, String mimeType, String language) { - String sampleType; - switch (mimeType) { - case "srt": - sampleType = MimeTypes.APPLICATION_SUBRIP; - break; - case "vtt": - sampleType = MimeTypes.TEXT_VTT; - break; - default: - return null; - } - Format textFormat = Format.createTextSampleFormat(title, sampleType, Format.NO_VALUE, language); + Format textFormat = Format.createTextSampleFormat(title, mimeType, Format.NO_VALUE, language); return new SingleSampleMediaSource(uri, mediaDataSourceFactory, textFormat, C.TIME_UNSET); }