meta-data in the VTT file header, a strawman proposal

This is a strawman proposal for the VTT header data (aka meta-data).  Feel free to critique, or suggest alternatives.  A number of companies really need something written so they can do experiments, so faster iteration is preferred :-)

* * * * * *

A VTT file may have non-cue data after the VTT header line, and before the blank line that precedes the first cue.  That non-cue data consists of meta-data, and maybe comments.

(I don't discuss comment syntax here)

The 'meta-data' consists of a series of keyword-value pairs, separated by an equals ('=') sign, with white space around the equals sign ignored.

Keywords are in two forms:
1) plain keywords, consisting of the upper and lower-case 'ASCII' letters, and numerals, only; (question: should this character set match attribute names in HTML5?)
2) qualified keywords, that contain one or more dash ('-') characters, and  in addition to the plain keyword character set

Case is not significant in keywords. All plain keywords are reserved for the specification.  Qualified keywords may be used for experimental or vendor-specific attributes; qualified keywords will not be specified by this specification.  It is recommended that vendor-specific keywords use the vendor name before the first dash.

The value may be a single-line value, or a multi-line value. In either case, the line-break at the end of the value does not form part of the value.

A single-line value extends from the first non-white-space character after the '=', to the end of line.

A multi-line value has the character pair '[[' as the only non-white-space characters on the keyword line.  The value is the set of lines starting at the next line, and ending at a line containing only the characters ']]'.  Within that set of lines (the 'body'), escaping is performed by adding a '\' character at the start of the line to all lines that are one of:
* lines that start with a '\'
* lines that are empty or consist solely of white-space
* lines that consist of only ']]'

On reception, the client removes all leading \ characters from the lines of the body.  Note that it is an error to encounter a blank or white-space only line, while accumulating lines before the closing ']]' line; such lines are required to have been escaped.


Examples:

kind=captions
examplecompany-test = for steve
initialTStimestamp=162642774
stylesheetURL=http://www.example.com/vtt-plain.css
stylesheet=     [[
 p { font-size: 100px; }
\
 p::first-line {
   background: url(http://www.w3.org/StyleSheets/TR/logo-REC) no-repeat;
   font-size: 10px;
   span { border-left: solid 1em black; }
 }
]]
srclang=en-US
label=Zeroes for King!


Specfiied keywords:

The attributes of the HTML5 track element are all valid keywords; each may occur only once.

In addition, the following are specified:
stylesheet - the value is a style sheet in CSS syntax; may occur more than once
stylesheetURL - the value is a URL for a CSS style sheet; may occur more than once. If the URL is relative, it is relative to the VTT file's URL
...

David Singer
Multimedia and Software Standards, Apple Inc.

Received on Friday, 24 February 2012 23:44:38 UTC