private void resolveUtcTimingElement(UtcTimingElement timingElement) { String scheme = timingElement.schemeIdUri; if (Util.areEqual(scheme, "urn:mpeg:dash:utc:direct:2014") || Util.areEqual(scheme, "urn:mpeg:dash:utc:direct:2012")) { resolveUtcTimingElementDirect(timingElement); } else if (Util.areEqual(scheme, "urn:mpeg:dash:utc:http-iso:2014") || Util.areEqual(scheme, "urn:mpeg:dash:utc:http-iso:2012")) { resolveUtcTimingElementHttp(timingElement, new Iso8601Parser()); } else if (Util.areEqual(scheme, "urn:mpeg:dash:utc:http-xsdate:2014") || Util.areEqual(scheme, "urn:mpeg:dash:utc:http-xsdate:2012")) { resolveUtcTimingElementHttp(timingElement, new XsDateTimeParser()); } else { // Unsupported scheme. onUtcTimestampResolutionError(new IOException("Unsupported UTC timing scheme")); } }
private void resolveUtcTimingElement(UtcTimingElement timingElement) { String scheme = timingElement.schemeIdUri; if (Util.areEqual(scheme, "urn:mpeg:dash:utc:direct:2012")) { resolveUtcTimingElementDirect(timingElement); } else if (Util.areEqual(scheme, "urn:mpeg:dash:utc:http-iso:2014")) { resolveUtcTimingElementHttp(timingElement, new Iso8601Parser()); } else if (Util.areEqual(scheme, "urn:mpeg:dash:utc:http-xsdate:2012") || Util.areEqual(scheme, "urn:mpeg:dash:utc:http-xsdate:2014")) { resolveUtcTimingElementHttp(timingElement, new XsDateTimeParser()); } else { // Unsupported scheme. onUtcTimestampResolutionError(new IOException("Unsupported UTC timing scheme")); } }
private void resolveUtcTimingElementDirect(UtcTimingElement timingElement) { try { long utcTimestamp = Util.parseXsDateTime(timingElement.value); onUtcTimestampResolved(utcTimestamp - manifestLoadEndTimestamp); } catch (ParserException e) { onUtcTimestampResolutionError(e); } }
private void resolveUtcTimingElementDirect(UtcTimingElement timingElement) { try { long utcTimestamp = Util.parseXsDateTime(timingElement.value); onUtcTimestampResolved(utcTimestamp - manifestLoadEndTimestamp); } catch (ParseException e) { onUtcTimestampResolutionError(new ParserException(e)); } }
private void resolveUtcTimingElementHttp(UtcTimingElement timingElement, ParsingLoadable.Parser<Long> parser) { startLoading(new ParsingLoadable<>(dataSource, Uri.parse(timingElement.value), C.DATA_TYPE_TIME_SYNCHRONIZATION, parser), new UtcTimestampCallback(), 1); }