Commit d47a6ed4 authored by Hampton Maxwell's avatar Hampton Maxwell
Browse files

Specify the text track type without any conversion

parent e2ea849d
Loading
Loading
Loading
Loading
+1 −12
Changes for android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java: 1 added line, 12 removed lines.
Original line number Diff line number Diff line
@@ -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);
    }