mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Default caption parsers to non-strict parsing.
This commit is contained in:
parent
39adcabf7d
commit
54d207f3ce
2 changed files with 13 additions and 5 deletions
|
|
@ -77,15 +77,15 @@ public class TtmlParser implements SubtitleParser {
|
||||||
private final boolean strictParsing;
|
private final boolean strictParsing;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Equivalent to {@code TtmlParser(true)}.
|
* Equivalent to {@code TtmlParser(false)}.
|
||||||
*/
|
*/
|
||||||
public TtmlParser() {
|
public TtmlParser() {
|
||||||
this(true);
|
this(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param strictParsing If true, {@link #parse(InputStream, String, long)} will throw a
|
* @param strictParsing If true, {@link #parse(InputStream, String, long)} will throw a
|
||||||
* {@link ParserException} if the stream contains invalid ttml. If false, the parser will
|
* {@link ParserException} if the stream contains invalid data. If false, the parser will
|
||||||
* make a best effort to ignore minor errors in the stream. Note however that a
|
* make a best effort to ignore minor errors in the stream. Note however that a
|
||||||
* {@link ParserException} will still be thrown when this is not possible.
|
* {@link ParserException} will still be thrown when this is not possible.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -68,13 +68,21 @@ public class WebvttParser implements SubtitleParser {
|
||||||
|
|
||||||
private final boolean strictParsing;
|
private final boolean strictParsing;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Equivalent to {@code WebvttParser(false)}.
|
||||||
|
*/
|
||||||
public WebvttParser() {
|
public WebvttParser() {
|
||||||
this(true);
|
this(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param strictParsing If true, {@link #parse(InputStream, String, long)} will throw a
|
||||||
|
* {@link ParserException} if the stream contains invalid data. If false, the parser will
|
||||||
|
* make a best effort to ignore minor errors in the stream. Note however that a
|
||||||
|
* {@link ParserException} will still be thrown when this is not possible.
|
||||||
|
*/
|
||||||
public WebvttParser(boolean strictParsing) {
|
public WebvttParser(boolean strictParsing) {
|
||||||
this.strictParsing = strictParsing;
|
this.strictParsing = strictParsing;
|
||||||
|
|
||||||
textBuilder = new StringBuilder();
|
textBuilder = new StringBuilder();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue