-
public class TTMLParser
Implementation of a parser which understands much of the DFXP TTML specification (though not all). Specifically, these items are recognized:
- Region element definitions
- Style element definitions
- Basic body structure with with P tags wrapped in top-level divs which contain spans, br's and unspanned text
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
TTMLParser.Namespaces
Namespaces specified by TTML specification.
public class
TTMLParser.Tags
All tags recognized in a TTML document.
public class
TTMLParser.Attributes
All XML attributes recognized in a TTML document.
-
Method Summary
Modifier and Type Method Description static TTMLDocument
parseXml(InputStream inputStream, String encoding)
Parses the given java.io.InputStream using the specified encoding. static TTMLDocument
parseXml(Reader reader)
Parses the given java.io.Reader into a com.brightcove.player.model.TTMLDocument. static int
parseTimeValue(String value)
Parses a string representing a time code position within a video following the format:HH:MM:ss. static long
parseTimeValueLong(String value)
Parses a string representing a time code position within a video following the format:HH:MM:ss. -
-
Method Detail
-
parseXml
static TTMLDocument parseXml(InputStream inputStream, String encoding)
Parses the given java.io.InputStream using the specified encoding.
- Parameters:
inputStream
- the stream containing the content to parseencoding
- the character encoding
-
parseXml
static TTMLDocument parseXml(Reader reader)
Parses the given java.io.Reader into a com.brightcove.player.model.TTMLDocument.
- Parameters:
reader
- the reader containing the content to parse
-
parseTimeValue
@Deprecated() static int parseTimeValue(String value)
Parses a string representing a time code position within a video following the format:HH:MM:ss.mmm or HH:MM:ss:mmWhere the following values are expected:
- HH - a 2 digit hours value, zero padded
- MM - a 2 digit minutes value, zero padded
- ss - a 2 digit seconds value, zero padded
- mmm - a 2 or 3 digit milliseconds value, zero padded
- Parameters:
value
- the time code expression to be parsed
-
parseTimeValueLong
static long parseTimeValueLong(String value)
Parses a string representing a time code position within a video following the format:HH:MM:ss.mmm or HH:MM:ss:mmWhere the following values are expected:
- HH - a 2 digit hours value, zero padded
- MM - a 2 digit minutes value, zero padded
- ss - a 2 digit seconds value, zero padded
- mmm - a 2 or 3 digit milliseconds value, zero padded
- Parameters:
value
- the time code expression to be parsed
-
-
-
-