public final class WebvttParserUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static float |
parsePercentage(java.lang.String s)
Parses a percentage and returns a scaled float.
|
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 ParserException
input
- The input from which the line should be read.ParserException
- 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
- contains the number to parse.java.lang.NumberFormatException
- if the number format is invalid or does not end with '%'.