From b82c0c5cce22d3bc7ae80087e2add3d6165b3564 Mon Sep 17 00:00:00 2001 From: Silvia Pfeiffer Date: Mon, 17 Jun 2013 14:04:30 +1000 Subject: [PATCH] Introduce the concept of WebVTT metadata headers. Create an abstract definition of WebVTT cue settings. --- webvtt.html | 93 +++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 66 insertions(+), 27 deletions(-) diff --git a/webvtt.html b/webvtt.html index 7a36ea3..7f32f78 100644 --- a/webvtt.html +++ b/webvtt.html @@ -821,13 +821,31 @@

WebVTT file structure

  • A single U+000D CARRIAGE RETURN (CR) character.
  • +

    A WebVTT metadata header consists of the following components, in + the given order:

    + +
      +
    1. A WebVTT metadata header name.
    2. +
    3. A U+003A COLON (colon) character.
    4. +
    5. A WebVTT metadata header value.
    6. +
    + +

    A WebVTT metadata header name and + a WebVTT metadata header value + each consist of any sequence of zero or more characters other than + U+000A LINE FEED (LF) characters and U+000D CARRIAGE RETURN (CR) characters + except that the entire resulting string must not contain the substring + "-->" (U+002D HYPHEN-MINUS, U+002D HYPHEN-MINUS, + U+003E GREATER-THAN SIGN).

    + +

    A WebVTT cue consists of the following components, in the given order:

    1. Optionally, a WebVTT cue identifier followed by a WebVTT line terminator.
    2. WebVTT cue timings.
    3. -
    4. Optionally, one or more U+0020 SPACE characters or U+0009 CHARACTER TABULATION (tab) characters followed by WebVTT cue settings.
    5. +
    6. Optionally, one or more U+0020 SPACE characters or U+0009 CHARACTER TABULATION (tab) characters followed by a WebVTT cue settings list.
    7. A WebVTT line terminator.
    8. The cue payload: either WebVTT caption cue text, WebVTT chapter title text, or WebVTT metadata text, but it must not contain the substring "-->" (U+002D HYPHEN-MINUS, U+002D HYPHEN-MINUS, U+003E GREATER-THAN SIGN).
    @@ -949,6 +967,24 @@

    WebVTT file structure

    +

    A WebVTT cue settings list consist of a sequence of zero or more + WebVTT cue settings in any order, separated from each other + by one or more U+0020 SPACE characters or U+0009 CHARACTER TABULATION (tab) characters. + Each setting consists of the following components, in the order given:

    + +
      +
    1. A WebVTT cue setting name.
    2. +
    3. An optional U+003A COLON (colon) character.
    4. +
    5. An optional WebVTT cue setting value.
    6. +
    + +

    A WebVTT cue setting name and a WebVTT cue setting value + each consist of any sequence of zero or more characters other than + U+000A LINE FEED (LF) characters and U+000D CARRIAGE RETURN (CR) characters + except that the entire resulting string must not contain the substring + "-->" (U+002D HYPHEN-MINUS, U+002D HYPHEN-MINUS, + U+003E GREATER-THAN SIGN).

    +

    WebVTT cue text consists of zero or more of the following, each optionally separated from the next by a WebVTT line terminator:

    @@ -1106,12 +1142,10 @@

    WebVTT files using chapter title text

    WebVTT files using caption cue text

    -

    The WebVTT cue settings part of a WebVTT - cue consists of zero or more of the following components, in - any order, separated from each other by one or more U+0020 SPACE - characters or U+0009 CHARACTER TABULATION (tab) characters. Each - component must not be included more than once per WebVTT cue - settings string.

    +

    The WebVTT cue settings list part of a WebVTT + caption cue consists of zero or more of the following settings. Each + setting must not be included more than once per WebVTT caption cue + settings list.

    -

    WebVTT cue settings give configuration +

    A WebVTT caption cue settings list gives configuration options regarding the position and alignment of the cue. For example, it allows a cue to be aligned to the left or positioned at the top right.

    -

    A WebVTT vertical text cue setting consists of the +

    A WebVTT vertical text cue setting is a WebVTT cue settingconsists of the following components, in the order given:

      -
    1. The string "vertical".
    2. -
    3. A U+003A COLON character (:).
    4. -
    5. One of the following strings: "rl", "lr".
    6. +
    7. The string "vertical" as the WebVTT cue setting name.
    8. +
    9. A U+003A COLON character (:).

    10. +
    11. One of the following strings as the WebVTT cue setting value: "rl", "lr".

    A WebVTT vertical text cue setting @@ -1144,9 +1178,9 @@

    WebVTT files using caption cue text

    following components, in the order given:

      -
    1. The string "line".

    2. +
    3. The string "line" as the WebVTT cue setting name.

    4. A U+003A COLON character (:).

    5. -
    6. Either: +
    7. As the WebVTT cue setting value either:
      To represent a specific position relative to the video frame
      @@ -1179,10 +1213,14 @@

      WebVTT files using caption cue text

      following components, in the order given:

        -
      1. The string "position".

      2. +
      3. The string "position" as the WebVTT cue setting name.

      4. A U+003A COLON character (:).
      5. -
      6. One or more ASCII digits.
      7. -
      8. A U+0025 PERCENT SIGN character (%).
      9. +
      10. As the WebVTT cue setting value: +
          +
        1. One or more ASCII digits.
        2. +
        3. A U+0025 PERCENT SIGN character (%).
        4. +
        +

      A WebVTT text position cue setting @@ -1197,10 +1235,14 @@

      WebVTT files using caption cue text

      following components, in the order given:

        -
      1. The string "size".

      2. +
      3. The string "size" as the WebVTT cue setting name.

      4. A U+003A COLON character (:).
      5. -
      6. One or more ASCII digits.
      7. -
      8. A U+0025 PERCENT SIGN character (%).
      9. +
      10. As the WebVTT cue setting value: +
          +
        1. One or more ASCII digits.
        2. +
        3. A U+0025 PERCENT SIGN character (%).
        4. +
        +

      A WebVTT size cue setting configures @@ -1213,9 +1255,9 @@

      WebVTT files using caption cue text

      following components, in the order given:

        -
      1. The string "align".

      2. +
      3. The string "align" as the WebVTT cue setting name.

      4. A U+003A COLON character (:).
      5. -
      6. One of the following strings: "start", "middle", "end", "left", "right"
      7. +
      8. One of the following strings as the WebVTT cue setting value: "start", "middle", "end", "left", "right"

      A WebVTT alignment cue setting @@ -1227,12 +1269,9 @@

      WebVTT files using caption cue text

      following components, in the order given:

        -
      1. The string "region".

      2. +
      3. The string "region" as the WebVTT cue setting name.

      4. A U+003A COLON character (:).

      5. -
      6. An arbitrary string of one or more characters other than U+0020 SPACE - or U+0009 CHARACTER TABULATION character. The string must not contain the substring - "-->" (U+002D HYPHEN-MINUS, U+002D HYPHEN-MINUS, - U+003E GREATER-THAN SIGN).

      7. +
      8. As the WebVTT cue setting value: an arbitrary string of one or more characters other than U+0020 SPACE or U+0009 CHARACTER TABULATION character. The string must not contain the substring "-->" (U+002D HYPHEN-MINUS, U+002D HYPHEN-MINUS, U+003E GREATER-THAN SIGN).

      A WebVTT region cue setting