Skip to content

Where should "headers" go relative to the WEBVTT magic string? #485

@icbaker

Description

@icbaker

We're implementing a WebVTT parser that also handles the X-TIMESTAMP-MAP header specified by Section 3.5 of HLS RFC 8216.

A question has come up about where headers should be in a WebVTT file. The spec seems to only mention "headers" in 6.1 WebVTT file parsing, and by my interpretation of steps 6 - 11 they must be on lines directly beneath WEBVTT (i.e. no blank lines in between). It seems step 6 allows for additional text after WEBVTT but then ignores/skips it in step 7. Then step 9 advances to the next line and step 11 parses any headers.

It seems by this algorithm this would be a valid file:

WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

00:00:46.582 --> 00:00:48.305
  First cue

However 4.1 WebVTT file structure seems to require one or more blank lines directly underneath WEBVTT (step 4) and doesn't mention headers at all. It does allow text immediately after WEBVTT on the first line (i.e. the same text that is skipped by the parsing algorithm) (step 3).

So by that interpretation, my example file above is invalid, and the only place to add 'extra' info to the start of the file is directly after WEBVTT, e.g.:

WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

00:00:46.582 --> 00:00:48.305
  First cue

But the X-TIMESTAMP-MAP data is now in the section that's skipped by step 7 of the algorithm in 6.1 WebVTT file parsing.

So I guess there's two questions:

  • Do 4.1 and 6.1 in the spec disagree about what lines can follow WEBVTT?
  • Should headers be directly beneath WEBVTT or on the same line, or is either valid?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions