@Override public void parse(String line, ParseState state) throws ParseException { super.parse(line, state); match(Constants.EXT_X_ENDLIST_PATTERN, line); state.getMedia().endOfList = true; }
@Override public void parse(String line, ParseState state) throws ParseException { super.parse(line, state); final Matcher matcher = match(Constants.EXTINF_PATTERN, line); state.getMedia().trackInfo = new TrackInfo(ParseUtil.parseFloat(matcher.group(1), getTag()), matcher.group(2)); }
@Override public void parse(String line, ParseState state) throws ParseException { super.parse(line, state); final StartData.Builder builder = new StartData.Builder(); parseAttributes(line, builder, state, HANDLERS); final StartData startData = builder.build(); state.getMedia().startData = startData; }
@Override public void parse(String line, ParseState state) throws ParseException { super.parse(line, state); match(Constants.EXT_X_I_FRAMES_ONLY_PATTERN, line); if (state.getCompatibilityVersion() < 4) { throw ParseException.create( ParseExceptionType.REQUIRES_PROTOCOL_VERSION_4_OR_HIGHER, getTag()); } state.setIsIframesOnly(); }
@Override public void parse(String line, ParseState state) throws ParseException { super.parse(line, state); final Matcher matcher = match(Constants.EXT_X_MEDIA_SEQUENCE_PATTERN, line); if (state.getMedia().mediaSequenceNumber != null) { throw ParseException.create( ParseExceptionType.MULTIPLE_EXT_TAG_INSTANCES, getTag(), line); } state.getMedia().mediaSequenceNumber = ParseUtil.parseInt(matcher.group(1), getTag()); }
@Override public void parse(String line, ParseState state) throws ParseException { super.parse(line, state); final Matcher matcher = match(Constants.EXT_X_TARGETDURATION_PATTERN, line); if (state.getMedia().targetDuration != null) { throw ParseException.create( ParseExceptionType.MULTIPLE_EXT_TAG_INSTANCES, getTag(), line); } state.getMedia().targetDuration = ParseUtil.parseInt(matcher.group(1), getTag()); }
@Override public void parse(String line, ParseState state) throws ParseException { super.parse(line, state); final Matcher matcher = match(Constants.EXT_X_PLAYLIST_TYPE_PATTERN, line); if (state.getMedia().playlistType != null) { throw ParseException.create( ParseExceptionType.MULTIPLE_EXT_TAG_INSTANCES, getTag(), line); } state.getMedia().playlistType = ParseUtil.parseEnum(matcher.group(1), PlaylistType.class, getTag()); }
@Override public void parse(String line, ParseState state) throws ParseException { super.parse(line, state); final EncryptionData.Builder builder = new EncryptionData.Builder() .withKeyFormat(Constants.DEFAULT_KEY_FORMAT) .withKeyFormatVersions(Constants.DEFAULT_KEY_FORMAT_VERSIONS); parseAttributes(line, builder, state, HANDLERS); final EncryptionData encryptionData = builder.build(); if (encryptionData.getMethod() != EncryptionMethod.NONE && encryptionData.getUri() == null) { throw ParseException.create(ParseExceptionType.MISSING_ENCRYPTION_URI, getTag(), line); } state.getMedia().encryptionData = encryptionData; }
@Override public void parse(String line, ParseState state) throws ParseException { super.parse(line, state); // deprecated }
@Override public void parse(String line, ParseState state) throws ParseException { validateNotMaster(state); state.setMedia(); super.parse(line, state); }