DashMediaSource class supports only "yyyy-MM-dd'T'HH:mm:ss'Z'" date format. Only one way how to change it is implement own custom DashMediaSource class. 806 lines of implementation for 1 line change. What about enable custom date format?
private static final class Iso8601Parser implements ParsingLoadable.Parser<Long> {
@Override
public Long parse(Uri uri, InputStream inputStream) throws IOException {
String firstLine = new BufferedReader(new InputStreamReader(inputStream)).readLine();
try {
// TODO: It may be necessary to handle timestamp offsets from UTC.
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.US);
format.setTimeZone(TimeZone.getTimeZone("UTC"));
return format.parse(firstLine).getTime();
} catch (ParseException e) {
throw new ParserException(e);
}
}
}
DashMediaSource class supports only "yyyy-MM-dd'T'HH:mm:ss'Z'" date format. Only one way how to change it is implement own custom DashMediaSource class. 806 lines of implementation for 1 line change. What about enable custom date format?