You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
WebVTT parser returns error if voice tag is on line by itself #348
00:11.000 --> 00:13.000
<v Roger Bingham> We are in New York City
Example 2
00:11.000 --> 00:13.000
<v Roger Bingham>
We are in New York City
The first is ok, but the second returns an "Invalid WebVTT file" error via webvtt.js > parseCue(). In the example, the value of nextLine is expected to be a timestamp but it's a string ("We are in New York City"), which triggers the error.
All of the examples of voice tags in the WebVTT spec have the voice tag followed by text on the same line, and this arrangement makes sense. However, the spec doesn't seem to require text on the same line as a voice tag, and the above is valid according to the Live WebVTT Validator.
Having the voice tag on a line by itself might in fact be common since the DCMP Captioning Key calls for speaker identification to be on a line by itself, wrapped in parentheses. Caption files created in other formats that conform to the Captioning Key recommendations might be converted into WebVTT with a simple search/replace, resulting in a voice tag on a line by itself.
I'm not having any luck figuring out where within the parser things are going awry, so if anyone can figure it out, please send a pull request!
Activity
[OPT] WebVTT pre-parsing cleanup ableplayer#348
[OPT] WebVTT pre-parsing cleanup ableplayer#348
joedolson commentedon Jun 27, 2026
Fixed by #743