Skip to content
This repository was archived by the owner on Jan 31, 2022. It is now read-only.

Commit 9669623

Browse files
committed
Fixed issue #1
First subtitle was not parsed, if the optional WEBVTT header is used
1 parent b933546 commit 9669623

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

jquery.webvtt.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,9 @@
5454
i = 0;
5555

5656
do {
57-
5857
// If there is the optional WebVTT Header, omit first two lines
5958
if (i === 0 && WEBVTT.test(lines[i])) {
60-
i += 2;
59+
i += 1;
6160
}
6261

6362
if (!CUE.test(lines[i])) {
@@ -74,7 +73,6 @@
7473
});
7574

7675
i += 1;
77-
7876
} while (i < lines.length);
7977

8078
return cues;
@@ -101,7 +99,7 @@
10199
matches = matches.add(cue.payload);
102100
}
103101
});
104-
102+
105103
return matches;
106104
};
107105

jquery.webvtt.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)