Skip to content

WebVTT parser returns error if voice tag is on line by itself  #348

Closed

Description

@terrill

Given these examples:

Example 1

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

  1. self-assigned this
    on Jul 5, 2024
  2. added this to the 5.1 milestone on May 24, 2026
  3. joedolson commented on Jun 27, 2026

    @joedolson
    Member

    Fixed by #743

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions