Short URL: http://html5.org/r/2080
| SVN | Bug | Comment | Time (UTC) |
|---|---|---|---|
| 2080 | More poking around getting the media element section to use the new event loop stuff. | 2008-08-19 00:57 |
Index: source
===================================================================
--- source (revision 2079)
+++ source (revision 2080)
@@ -16202,7 +16202,7 @@
title="dom-media-load">load()</code> method on the <span>media
element</span>, and ignores any resulting exceptions. The <span>task
source</span> for this task is the <span>media element</span>'s own
- <span>new resource task source</span>.</p>
+ <span>media element new resource task source</span>.</p>
<p>The DOM attributes <dfn
title="dom-source-src"><code>src</code></dfn>, <dfn
@@ -16336,8 +16336,17 @@
resource</dfn> is used to refer to the complete set of media data,
e.g. the complete video file, or complete audio file.</p>
+ <p><span title="media element">Media elements</span> use two <span
+ title="task queue">task queues</span>, the <dfn>media element event
+ task source</dfn> for asynchronous events and callbacks, and the
+ <dfn>media element new resource task source</dfn> for handling
+ implicit loads. Unless otherwise specified, all the tasks <span
+ title="queue a task">queued</span> in this section and its
+ subsections use the <span>media element event task
+ source</span>.</p>
+
<h5>Error codes</h5>
<p>All <span title="media element">media elements</span> have an
@@ -16395,8 +16404,8 @@
implicitly invokes the <code title="dom-media-load">load()</code>
method on the <span>media element</span>, and ignores any resulting
exceptions. The <span>task source</span> for this task is the
- <span>media element</span>'s own <span>new resource task
- source</span>.</p>
+ <span>media element</span>'s own <span>media element new resource
+ task source</span>.</p>
<p class="note">If a <code title="attr-media-src">src</code>
attribute is specified, the resource it specifies is the <span>media
@@ -16578,11 +16587,20 @@
<ol>
- <li><p>If there are any <span title="concept-task">tasks</span>
- from the <span>media element</span>'s own <dfn>new resource task
- source</dfn> in one of the <span title="task queue">task
- queues</span>, then remove those tasks.</p></li>
+ <li>
+ <p>If there are any <span title="concept-task">tasks</span> from
+ the <span>media element</span>'s <span>media element new resource
+ task source</span> or its <span>media element event task
+ source</span> in one of the <span title="task queue">task
+ queues</span>, then remove those tasks.</p>
+
+ <p class="note">Basically, pending events, callbacks, and loads
+ for the media element are discarded when the media element starts
+ loading a new resource.</p>
+
+ </li>
+
<li><p>Any already-running instance of this algorithm for this
element must be aborted. If those method calls have not yet
returned, they must finish the step they are on, and then
@@ -16969,8 +16987,8 @@
implicitly invokes the <code title="dom-media-load">load()</code>
method on the <span>media element</span>, and ignores any resulting
exceptions. The <span>task source</span> for this task is the
- <span>media element</span>'s own <span>new resource task
- source</span>.</p>
+ <span>media element</span>'s own <span>media element new resource
+ task source</span>.</p>
<p>The <dfn
title="dom-media-bufferingRate"><code>bufferingRate</code></dfn>
@@ -17034,10 +17052,10 @@
<p>When the length of the <span>media resource</span> changes
(e.g. from being unknown to known, or from indeterminate to known,
or from a previously established length to a new length) the user
- agent must, once any running scripts have finished, <span>fire a
- simple event</span> called <code
+ agent must <span>queue a task</span> to <span>fire a simple
+ event</span> called <code
title="event-durationchange">durationchange</code> at the
- <span>media element</span>.</p><!-- xxx queue -->
+ <span>media element</span>.</p>
<p><span title="media element">Media elements</span> have a
<dfn>current playback position</dfn>, which must initially be
@@ -17441,28 +17459,28 @@
having <span>ended playback</span>, or playback having <span>stopped
due to errors</span>, or playback having <span>paused for user
interaction</span>, or the <span title="dom-media-seek">seeking
- algorithm</span> being invoked, the user agent must <span>fire a
- simple event</span> called <code
- title="event-timeupdate">timeupdate</code> at the element, and then
- must <span>fire a simple event</span> called <code
- title="event-waiting">waiting</code> at the element.</p><!-- xxx queue -->
+ algorithm</span> being invoked, the user agent must <span>queue a
+ task</span> to <span>fire a simple event</span> called <code
+ title="event-timeupdate">timeupdate</code> at the element, and
+ <span>queue a task</span> to <span>fire a simple event</span> called
+ <code title="event-waiting">waiting</code> at the element.</p>
<p>When a <span>media element</span> that is <span>actively
playing</span> stops playing because it has <span>paused for user
- interaction</span>, the user agent must <span>fire a simple
- event</span> called <code title="event-timeupdate">timeupdate</code>
- at the element.</p><!-- xxx queue -->
+ interaction</span>, the user agent must <span>queue a task</span> to
+ <span>fire a simple event</span> called <code
+ title="event-timeupdate">timeupdate</code> at the element.</p>
<p>When <code title="dom-media-currentLoop">currentLoop</code> is
less than <span><code
title="dom-media-playCount">playCount</code>-1</span> and the
<span>current playback position</span> reaches the <var>effective
- loop end</var>, then the user agent must <span
+ loop end</var>, then the user agent must increase <code
+ title="dom-media-currentLoop">currentLoop</code> by 1, <span>queue a
+ task</span> to <span>fire a simple event</span> called <code
+ title="event-timeupdate">timeupdate</code>, and <span
title="dom-media-seek">seek</span> to the <var>effective loop
- start</var>, increase <code
- title="dom-media-currentLoop">currentLoop</code> by 1, and
- <span>fire a simple event</span> called <code
- title="event-timeupdate">timeupdate</code>.</p><!-- xxx queue -->
+ start</var>.</p>
<p>When <code title="dom-media-currentLoop">currentLoop</code> is
equal to the <span><code
@@ -17477,12 +17495,13 @@
<li><p class="note">The <code title="dom-media-ended">ended</code>
attribute becomes true.</p></li>
- <li><p>The user agent must <span>fire a simple event</span> called
- <code title="event-timeupdate">timeupdate</code> at the
- element.</p></li><!-- xxx queue -->
+ <li><p>The user agent must <span>queue a task</span> to <span>fire
+ a simple event</span> called <code
+ title="event-timeupdate">timeupdate</code> at the element.</p></li>
- <li><p>The user agent must <span>fire a simple event</span> called
- <code title="event-ended">ended</code> at the element.</p></li>
+ <li><p>The user agent must <span>queue a task</span> to <span>fire
+ a simple event</span> called <code title="event-ended">ended</code>
+ at the element.</p></li>
</ol>
@@ -17514,14 +17533,14 @@
<code title="dom-media-playbackRate">playbackRate</code> attributes
change value (either by being set by script or by being changed
directly by the user agent, e.g. in response to user control) the
- user agent must, once any running scripts have finished, <span>fire
+ user agent must <span>queue a task</span> to <span>fire
a simple event</span> called <code
title="event-ratechange">ratechange</code> at the <span>media
- element</span>.</p><!-- xxx queue -->
+ element</span>.</p>
+ <hr>
-
<p>When the <dfn title="dom-media-play"><code>play()</code></dfn>
method on a <span>media element</span> is invoked, the user agent
must run the following steps.</p>