WebVTT Observations
Update #
The WebVTT Draft Spec has been updated to allow metadata headers. This corrects all the issues outlined in this post. :)
According to the WebVTT Draft Spec, a WebVTT file must start with the string “WEBVTT” followed by some text that does not include a line break, followed by two line breaks. This pretty much kills the idea of including header metadata. Yet, WebVTT files produced by YouTube break this rule and include some extra data in the header (along with line breaks), breaking the spec.
WEBVTT
Kind: captions
Language: en
It would be nice if the spec allowed for metadata to be added like this. It would be nice if the spec allowed for something like RDF or microdata, but I understand that one of the beauties of WebVTT is its low markup to content ratio.
Additionally, it would be nice to have support for a GUID, or even an alternative content link to the webpage where this WebVTT file is embedded, or even a link directly to the video file this WebVTT file belongs with. This way, if the WebVTT file is orphaned, one can make a reasonable guess about what it is and where it belongs without the contextual data from the parent HTML document.
It would be nice to have a semantic way to markup sounds, or even who is speaking. Currently, we can use voice tags, but that only seems to get us part of the way there. Note: I’m thinking about this mostly from a “Search Engines Indexing Captions” perspective.
On that note, when will we be able to include WebVTT files in Video Sitemaps?
Why doesn’t the HTML <track>
element support the type
attribute, like the <source>
element? What happens when we discover the thing that is way better than WebVTT? This seems like a step in the wrong direction.
WebVTT files must be UTF-8. The Content-Type
must be text/vtt
, and specifies no required or optional parameters. Why, then, are so many WebVTT files being served with the Content-Type text/vtt; charset=utf-8
?
If WebVTT cue identifiers can contain spaces, how would we reference these IDs in CSS?
The folks at WebVTT contacted me on Twitter regarding metadata at the begining of the file.
I believe the bug referred to is Bug 15851.
@WebVTT files downloaded from @YouTube contain illegal metadata in the header, which is disallowed by the spec. Yay.
— Pat Hawks (@PatHawks) May 10, 2013
@pathawks Actually, it’s not disallowed - it’s just not part of the syntax spec. The parsing spec, however, parses it out.
— webvtt (@webvtt) June 16, 2013
@webvtt “…followed by any number of characters that are not LINE FEED (LF) or CARRIAGE RETURN (CR) characters” http://t.co/MKBd3tyh9t
— Pat Hawks (@PatHawks) June 16, 2013
@pathawks right, but then it needs 2 line terminators to move on, so single newlines are also ignored
— webvtt (@webvtt) June 17, 2013
@webvtt Understood. It just seems like the spec could mention this use case. Is there a reason to leave it out?
— Pat Hawks (@PatHawks) June 17, 2013
@pathawks the editor hasn’t got around to it yet - there’s a bug in the bug tracker :-)
— webvtt (@webvtt) June 17, 2013
@webvtt I’m glad to hear it :)
— Pat Hawks (@PatHawks) June 17, 2013