Description
openedon Sep 30, 2016
We use SmoothStreaming / Playready and depend on Side Loading independent TTML Subtitles.
Found two problems trying to Side Load TTML Subtitles using MergingMediaSource containing SingleSampleMediaSource and SsMediaSource:
1-
DefaultTrackSelector.selectTextTrack correctly receives the TTML track, but it never gets it selected.
Hint : adjusting the score check in a DefaultTrackSelector subclass to be {if (trackScore >= selectedTrackScore) ... } , Solved it and got it selected.
2 -
Received crash:
Caused by: java.lang.NullPointerException: Attempt to get length of null array
at com.google.android.exoplayer2.source.SingleSampleMediaPeriod$SourceLoadable.load(SingleSampleMediaPeriod.java:272)
Examining this NullPointerException crash , we found that it is checking length of SourceLoadable.sampleData before it ever gets initialized or assigned.