Commit 6f3ccc36 by Oliver Woodman

Handle byte-order-mark prefix to WebVTT file.

Issue: #268
parent ed0b02d0
...@@ -87,6 +87,7 @@ public class WebvttParser implements SubtitleParser { ...@@ -87,6 +87,7 @@ public class WebvttParser implements SubtitleParser {
if (line == null) { if (line == null) {
throw new ParserException("Expected WEBVTT or EXO-HEADER. Got null"); throw new ParserException("Expected WEBVTT or EXO-HEADER. Got null");
} }
if (line.startsWith(EXO_HEADER)) { if (line.startsWith(EXO_HEADER)) {
// parse the timestamp offset, if present // parse the timestamp offset, if present
Matcher matcher = MEDIA_TIMESTAMP_OFFSET.matcher(line); Matcher matcher = MEDIA_TIMESTAMP_OFFSET.matcher(line);
...@@ -100,7 +101,8 @@ public class WebvttParser implements SubtitleParser { ...@@ -100,7 +101,8 @@ public class WebvttParser implements SubtitleParser {
throw new ParserException("Expected WEBVTT. Got null"); throw new ParserException("Expected WEBVTT. Got null");
} }
} }
if (!line.equals("WEBVTT")) {
if (!line.equals("WEBVTT") && !line.equals("\uFEFFWEBVTT")) {
throw new ParserException("Expected WEBVTT. Got " + line); throw new ParserException("Expected WEBVTT. Got " + line);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment