OSDN Git Service

WebVttRenderer: allow BOM at beginning of a WebVTT file.
authorLajos Molnar <lajos@google.com>
Tue, 24 Sep 2013 16:35:47 +0000 (09:35 -0700)
committerLajos Molnar <lajos@google.com>
Tue, 24 Sep 2013 17:13:43 +0000 (10:13 -0700)
This is part of the spec.

Change-Id: I61ccc259c0b9d3a2bc4273925665d107b0c89c62
Signed-off-by: Lajos Molnar <lajos@google.com>
Bug: 10900755

media/java/android/media/WebVttRenderer.java

index 74773a8..edde68d 100644 (file)
@@ -690,6 +690,9 @@ class WebVttParser {
     final private Phase mParseStart = new Phase() { // 5-9
         @Override
         public void parse(String line) {
+            if (line.startsWith("\ufeff")) {
+                line = line.substring(1);
+            }
             if (!line.equals("WEBVTT") &&
                     !line.startsWith("WEBVTT ") &&
                     !line.startsWith("WEBVTT\t")) {