Skip to content

Commit

Permalink
[ac] (3) Define a syntax for comments in WebVTT (doesn't affect parsers)
Browse files Browse the repository at this point in the history
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=14552
Affected topics: Video Text Tracks

git-svn-id: http://svn.whatwg.org/webapps@7500 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Nov 1, 2012
1 parent f81f876 commit 460363e
Showing 1 changed file with 85 additions and 7 deletions.
92 changes: 85 additions & 7 deletions source
Expand Up @@ -39018,7 +39018,7 @@ The General Relativistic Field Equations</pre>

</div>

<!--END w3c-html--><!--END complete-->
<!--END complete-->
<div data-component="other Hixie drafts (editor: Ian Hickson)">
<h5>WebVTT</h5>
<!--FIXUP dev-html +4-->
Expand All @@ -39039,8 +39039,6 @@ The General Relativistic Field Equations</pre>
DEFAULTS
line:-1 align:middle size:50%

Comments. See http://www.w3.org/Bugs/Public/show_bug.cgi?id=14552

-->


Expand Down Expand Up @@ -39164,6 +39162,61 @@ The Organisation for Sample Public Service Announcements accepts no liability fo

</div>


<h3>Comments</h3>

<!--END dev-html--><p><i>This section is non-normative.</i></p><!--START dev-html-->

<p>Comments can be included in WebVTT files.</p>

<p>Comments are just blocks that start with the word "<code title="">NOTE</code>" or "<code
title="">NOTES</code>" (followed by a space or newline). A comment ends at the first blank
line.</p>

<div class="example">

<p>Here, a one-line comment is used to note a possible problem with a cue.</p>

<pre>WEBVTT

00:01.000 --> 00:04.000
Never drink liquid nitrogen.

NOTE I'm not sure the timing is write on the following cue.

00:05.000 --> 00:09.000
&mdash; It will perforate your stomach.
&mdash; You could die.</pre>

</div>

<div class="example">

<p>In this example, the author has written many comments.</p>

<pre>WEBVTT

NOTES
This file was written by Jill. I hope
you enjoy reading it. Some things to
bear in mind:
- I was lip-reading, so the cues may
not be 100% accurate
- I didn't pay too close attention to
when the cues should start or end.

00:01.000 --> 00:04.000
Never drink liquid nitrogen.

NOTES check next cue

00:05.000 --> 00:09.000
&mdash; It will perforate your stomach.
&mdash; You could die.

NOTES end of file</pre>

</div>



Expand Down Expand Up @@ -39253,9 +39306,9 @@ The Organisation for Sample Public Service Announcements accepts no liability fo
line, the second one to terminate the header block: in the future,
we can add a metadata block before the first blank line -->

<li>Zero or more <span title="WebVTT cue">WebVTT cues</span>
separated from each other by two or more <span title="WebVTT line
terminator">WebVTT line terminators</span>.</li>
<li>Zero or more <span title="WebVTT cue">WebVTT cues</span> and/or <span title="WebVTT
comments">WebVTT comments</span> separated from each other by two or more <span title="WebVTT
line terminator">WebVTT line terminators</span>.</li>

<li>Zero or more <span title="WebVTT line terminator">WebVTT line
terminators</span>.</li>
Expand All @@ -39270,7 +39323,7 @@ The Organisation for Sample Public Service Announcements accepts no liability fo
<li><span>WebVTT cue timings</span>.</li>
<li>Optionally, one or more U+0020 SPACE characters or U+0009 CHARACTER TABULATION (tab) characters followed by <span>WebVTT cue settings</span>.</li>
<li>A <span>WebVTT line terminator</span>.</li>
<li>The <dfn>cue payload</dfn>: either <span>WebVTT cue text</span>, <span>WebVTT chapter title text</span>, or <span>WebVTT metadata text</span>, but it must not contain the substring "-->" (U+002D HYPHEN-MINUS, U+002D HYPHEN-MINUS, U+003E GREATER-THAN SIGN).</li>
<li>The <dfn>cue payload</dfn>: either <span>WebVTT cue text</span>, <span>WebVTT chapter title text</span>, or <span>WebVTT metadata text</span>, but it must not contain the substring "<code title="">--></code>" (U+002D HYPHEN-MINUS, U+002D HYPHEN-MINUS, U+003E GREATER-THAN SIGN).</li>
</ol>

<p class="note">A <span>WebVTT cue</span> corresponds to one piece
Expand Down Expand Up @@ -39299,6 +39352,31 @@ The Organisation for Sample Public Service Announcements accepts no liability fo
is a <span>WebVTT file using chapter title text</span> is also a
<span>WebVTT file using cue text</span>.</p>


<p>A <dfn>WebVTT comment</dfn> consists of the following components, in
the given order:</p>

<ol>
<li>The string "<code title="">NOTE</code>".</li>
<li>Optionally, a U+0053 LATIN CAPITAL LETTER S character.</li>
<li>Optionally, the following components, in the given order:
<ol>
<li>Either:
<ul>
<li>A U+0020 SPACE character or U+0009 CHARACTER TABULATION (tab) character.</li>
<li>A <span>WebVTT line terminator</span>.</li>
</ul>
<li>Any sequence of zero or more characters other than U+000A LINE FEED (LF) characters and
U+000D CARRIAGE RETURN (CR) characters, each optionally separated from the next by a
<span>WebVTT line terminator</span>, except that the entire resulting string must not contain
the substring "<code title="">--></code>" (U+002D HYPHEN-MINUS, U+002D HYPHEN-MINUS, U+003E GREATER-THAN SIGN).
</ol>
</li>
</ol>

<p class="note">A <span>WebVTT comment</span> is ignored by the parser.</p>


<p>A <dfn>WebVTT line terminator</dfn> consists of one of the
following:</p>

Expand Down

0 comments on commit 460363e

Please sign in to comment.