public final class WebvttParserUtil
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.util.regex.Matcher |
findNextCueHeader(ParsableByteArray input)
Reads lines up to and including the next WebVTT cue header.
|
static float |
parsePercentage(java.lang.String s)
Parses a percentage string.
|
static long |
parseTimestampUs(java.lang.String timestamp)
Parses a WebVTT timestamp.
|
static void |
validateWebvttHeaderLine(ParsableByteArray input)
Reads and validates the first line of a WebVTT file.
|
public static void validateWebvttHeaderLine(ParsableByteArray input) throws SubtitleDecoderException
input - The input from which the line should be read.SubtitleDecoderException - If the line isn't the start of a valid WebVTT file.public static long parseTimestampUs(java.lang.String timestamp)
throws java.lang.NumberFormatException
timestamp - The timestamp string.java.lang.NumberFormatException - If the timestamp could not be parsed.public static float parsePercentage(java.lang.String s)
throws java.lang.NumberFormatException
s - The percentage string.java.lang.NumberFormatException - If the percentage could not be parsed.public static java.util.regex.Matcher findNextCueHeader(ParsableByteArray input)
input - The input from which lines should be read.Matcher for the WebVTT cue header, or null if the end of the input was
reached without a cue header being found. In the case that a cue header is found, groups 1,
2 and 3 of the returned matcher contain the start time, end time and settings list.