Skip to content

Commit

Permalink
[giow] (0) Add an 'ended' event to MediaController.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.whatwg.org/webapps@6026 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Apr 25, 2011
1 parent 4df4cf0 commit fbdee45
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 20 deletions.
41 changes: 34 additions & 7 deletions complete.html
Expand Up @@ -239,7 +239,7 @@

<header class=head id=head><p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1>Web Applications 1.0</h1>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 22 April 2011</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 25 April 2011</h2>
</hgroup><p>You can take part in this work. <a href=http://www.whatwg.org/mailing-list>Join the working group's discussion list.</a></p>
<p><strong>Web designers!</strong> We have a <a href=http://blog.whatwg.org/faq/>FAQ</a>, a <a href=http://forums.whatwg.org/>forum</a>, and a <a href=http://www.whatwg.org/mailing-list#help>help mailing list</a> for you!</p>
<!--<p class="impl"><strong>Implementors!</strong> We have a <a href="http://www.whatwg.org/mailing-list#implementors">mailing list</a> for you too!</p>-->
Expand Down Expand Up @@ -29552,7 +29552,7 @@ <h6 id=media-controllers><span class=secno>4.8.10.11.2 </span>Media controllers<
readiness state</dfn>, which is a number from 0 to 4 derived from
the numbers used for the <a href=#media-element>media element</a> <code title=attr-media-readyState>readyState</code> attribute, and a
<dfn id=most-recently-reported-playback-state>most recently reported playback state</dfn>, which is either
<i>playing</i> or <i>waiting</i>.</p>
<i>playing</i>, <i>waiting</i>, or <i>ended</i>.</p>

<p>When a <code><a href=#mediacontroller>MediaController</a></code> is created, its <a href=#most-recently-reported-readiness-state>most
recently reported readiness state</a> must be set to 0, and its
Expand Down Expand Up @@ -29607,16 +29607,40 @@ <h6 id=media-controllers><span class=secno>4.8.10.11.2 </span>Media controllers<
reported readiness state</a> be <var title="">new readiness
state</var>.</li>

<li><p>If the <code><a href=#mediacontroller>MediaController</a></code> has no <a href=#slaved-media-elements>slaved
media elements</a>, or the <code><a href=#mediacontroller>MediaController</a></code> is a
<a href=#blocked-media-controller>blocked media controller</a>, let <var title="">new
playback state</var> be false; otherwise, let it be true.</li>
<li>

<p>Initialize <var title="">new playback state</var> by setting it
to the state given for the first matching condition from the
following list:</p>

<dl class=switch><dt>If the <code><a href=#mediacontroller>MediaController</a></code> has no <a href=#slaved-media-elements>slaved
media elements</a></dt>

<dd>Let <var title="">new playback state</var> be <i>waiting</i>.</dd>

<dt>If all of the <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#slaved-media-elements>slaved
media elements</a> have <a href=#ended-playback>ended playback</a> and the
<a href=#media-controller-playback-rate>media controller playback rate</a> is positive or
zero</dt>

<dd>Let <var title="">new playback state</var> be <i>ended</i>.</dd>

<dt>If the <code><a href=#mediacontroller>MediaController</a></code> is a <a href=#blocked-media-controller>blocked media
controller</a></dt>

<dd>Let <var title="">new playback state</var> be <i>waiting</i>.</dd>

<dt>Otherwise</dt>

<dd>Let <var title="">new playback state</var> be <i>playing</i>.</dd>

</dl></li>

<li><p>If the <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#most-recently-reported-playback-state>most recently
reported playback state</a> is not equal to <var title="">new
playback state</var> then <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a
simple event</a> at the <code><a href=#mediacontroller>MediaController</a></code> object,
whose name is <code title=event-MediaController-playing><a href=#event-mediacontroller-playing>playing</a></code> if <var title="">new playback state</var> is true, and whose name is <code title=event-MediaController-waiting><a href=#event-mediacontroller-waiting>waiting</a></code>
whose name is <code title=event-MediaController-playing><a href=#event-mediacontroller-playing>playing</a></code> if <var title="">new playback state</var> is <i>playing</i>, <code title=event-MediaController-ended>ended</code> if <var title="">new playback state</var> is <i>ended</i>, and <code title=event-MediaController-waiting><a href=#event-mediacontroller-waiting>waiting</a></code>
otherwise.</li>

<li><p>Let the <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#most-recently-reported-playback-state>most recently
Expand Down Expand Up @@ -33479,6 +33503,9 @@ <h5 id=mediaevents><span class=secno>4.8.10.16 </span>Event summary</h5>
<tr><td><dfn id=event-mediacontroller-waiting title=event-MediaController-waiting><code>waiting</code></dfn>
<td><code><a href=#event>Event</a></code>
<td>The <code><a href=#mediacontroller>MediaController</a></code> is now a <a href=#blocked-media-controller>blocked media controller</a>.
<tr><td><dfn id=event-mediacontcoller-ended title=event-MediaContcoller-ended><code>ended</code></dfn>
<td><code><a href=#event>Event</a></code>
<td>All the <a href=#slaved-media-elements>slaved media elements</a> have newly <a href=#ended-playback>ended playback</a>.

<tbody><tr><td><dfn id=event-mediacontroller-durationchange title=event-MediaController-durationchange><code>durationchange</code></dfn>
<td><code><a href=#event>Event</a></code>
Expand Down
41 changes: 34 additions & 7 deletions index
Expand Up @@ -243,7 +243,7 @@

<header class=head id=head><p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 22 April 2011</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 25 April 2011</h2>
</hgroup><p>You can take part in this work. <a href=http://www.whatwg.org/mailing-list>Join the working group's discussion list.</a></p>
<p><strong>Web designers!</strong> We have a <a href=http://blog.whatwg.org/faq/>FAQ</a>, a <a href=http://forums.whatwg.org/>forum</a>, and a <a href=http://www.whatwg.org/mailing-list#help>help mailing list</a> for you!</p>
<!--<p class="impl"><strong>Implementors!</strong> We have a <a href="http://www.whatwg.org/mailing-list#implementors">mailing list</a> for you too!</p>-->
Expand Down Expand Up @@ -29564,7 +29564,7 @@ interface <dfn id=mediacontroller>MediaController</dfn> {
readiness state</dfn>, which is a number from 0 to 4 derived from
the numbers used for the <a href=#media-element>media element</a> <code title=attr-media-readyState>readyState</code> attribute, and a
<dfn id=most-recently-reported-playback-state>most recently reported playback state</dfn>, which is either
<i>playing</i> or <i>waiting</i>.</p>
<i>playing</i>, <i>waiting</i>, or <i>ended</i>.</p>

<p>When a <code><a href=#mediacontroller>MediaController</a></code> is created, its <a href=#most-recently-reported-readiness-state>most
recently reported readiness state</a> must be set to 0, and its
Expand Down Expand Up @@ -29619,16 +29619,40 @@ interface <dfn id=mediacontroller>MediaController</dfn> {
reported readiness state</a> be <var title="">new readiness
state</var>.</li>

<li><p>If the <code><a href=#mediacontroller>MediaController</a></code> has no <a href=#slaved-media-elements>slaved
media elements</a>, or the <code><a href=#mediacontroller>MediaController</a></code> is a
<a href=#blocked-media-controller>blocked media controller</a>, let <var title="">new
playback state</var> be false; otherwise, let it be true.</li>
<li>

<p>Initialize <var title="">new playback state</var> by setting it
to the state given for the first matching condition from the
following list:</p>

<dl class=switch><dt>If the <code><a href=#mediacontroller>MediaController</a></code> has no <a href=#slaved-media-elements>slaved
media elements</a></dt>

<dd>Let <var title="">new playback state</var> be <i>waiting</i>.</dd>

<dt>If all of the <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#slaved-media-elements>slaved
media elements</a> have <a href=#ended-playback>ended playback</a> and the
<a href=#media-controller-playback-rate>media controller playback rate</a> is positive or
zero</dt>

<dd>Let <var title="">new playback state</var> be <i>ended</i>.</dd>

<dt>If the <code><a href=#mediacontroller>MediaController</a></code> is a <a href=#blocked-media-controller>blocked media
controller</a></dt>

<dd>Let <var title="">new playback state</var> be <i>waiting</i>.</dd>

<dt>Otherwise</dt>

<dd>Let <var title="">new playback state</var> be <i>playing</i>.</dd>

</dl></li>

<li><p>If the <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#most-recently-reported-playback-state>most recently
reported playback state</a> is not equal to <var title="">new
playback state</var> then <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a
simple event</a> at the <code><a href=#mediacontroller>MediaController</a></code> object,
whose name is <code title=event-MediaController-playing><a href=#event-mediacontroller-playing>playing</a></code> if <var title="">new playback state</var> is true, and whose name is <code title=event-MediaController-waiting><a href=#event-mediacontroller-waiting>waiting</a></code>
whose name is <code title=event-MediaController-playing><a href=#event-mediacontroller-playing>playing</a></code> if <var title="">new playback state</var> is <i>playing</i>, <code title=event-MediaController-ended>ended</code> if <var title="">new playback state</var> is <i>ended</i>, and <code title=event-MediaController-waiting><a href=#event-mediacontroller-waiting>waiting</a></code>
otherwise.</li>

<li><p>Let the <code><a href=#mediacontroller>MediaController</a></code>'s <a href=#most-recently-reported-playback-state>most recently
Expand Down Expand Up @@ -33491,6 +33515,9 @@ interface <dfn id=texttrackcue>TextTrackCue</dfn> {
<tr><td><dfn id=event-mediacontroller-waiting title=event-MediaController-waiting><code>waiting</code></dfn>
<td><code><a href=#event>Event</a></code>
<td>The <code><a href=#mediacontroller>MediaController</a></code> is now a <a href=#blocked-media-controller>blocked media controller</a>.
<tr><td><dfn id=event-mediacontcoller-ended title=event-MediaContcoller-ended><code>ended</code></dfn>
<td><code><a href=#event>Event</a></code>
<td>All the <a href=#slaved-media-elements>slaved media elements</a> have newly <a href=#ended-playback>ended playback</a>.

<tbody><tr><td><dfn id=event-mediacontroller-durationchange title=event-MediaController-durationchange><code>durationchange</code></dfn>
<td><code><a href=#event>Event</a></code>
Expand Down
46 changes: 40 additions & 6 deletions source
Expand Up @@ -32222,7 +32222,7 @@ interface <dfn>MediaController</dfn> {
the numbers used for the <span>media element</span> <code
title="attr-media-readyState">readyState</code> attribute, and a
<dfn>most recently reported playback state</dfn>, which is either
<i>playing</i> or <i>waiting</i>.</p>
<i>playing</i>, <i>waiting</i>, or <i>ended</i>.</p>

<p>When a <code>MediaController</code> is created, its <span>most
recently reported readiness state</span> must be set to 0, and its
Expand Down Expand Up @@ -32292,18 +32292,48 @@ interface <dfn>MediaController</dfn> {
reported readiness state</span> be <var title="">new readiness
state</var>.</p></li>

<li><p>If the <code>MediaController</code> has no <span>slaved
media elements</span>, or the <code>MediaController</code> is a
<span>blocked media controller</span>, let <var title="">new
playback state</var> be false; otherwise, let it be true.</p></li>
<li>

<p>Initialize <var title="">new playback state</var> by setting it
to the state given for the first matching condition from the
following list:</p>

<dl class="switch">

<dt>If the <code>MediaController</code> has no <span>slaved
media elements</span></dt>

<dd>Let <var title="">new playback state</var> be <i>waiting</i>.</dd>

<dt>If all of the <code>MediaController</code>'s <span>slaved
media elements</span> have <span>ended playback</span> and the
<span>media controller playback rate</span> is positive or
zero</dt>

<dd>Let <var title="">new playback state</var> be <i>ended</i>.</dd>

<dt>If the <code>MediaController</code> is a <span>blocked media
controller</span></dt>

<dd>Let <var title="">new playback state</var> be <i>waiting</i>.</dd>

<dt>Otherwise</dt>

<dd>Let <var title="">new playback state</var> be <i>playing</i>.</dd>

</dl>

</li>

<li><p>If the <code>MediaController</code>'s <span>most recently
reported playback state</span> is not equal to <var title="">new
playback state</var> then <span>queue a task</span> to <span>fire a
simple event</span> at the <code>MediaController</code> object,
whose name is <code
title="event-MediaController-playing">playing</code> if <var
title="">new playback state</var> is true, and whose name is <code
title="">new playback state</var> is <i>playing</i>, <code
title="event-MediaController-ended">ended</code> if <var
title="">new playback state</var> is <i>ended</i>, and <code
title="event-MediaController-waiting">waiting</code>
otherwise.</p></li>

Expand Down Expand Up @@ -36854,6 +36884,10 @@ interface <dfn>TextTrackCue</dfn> {
<td><dfn title="event-MediaController-waiting"><code>waiting</code></dfn>
<td><code>Event</code>
<td>The <code>MediaController</code> is now a <span>blocked media controller</span>.
<tr>
<td><dfn title="event-MediaContcoller-ended"><code>ended</code></dfn>
<td><code>Event</code>
<td>All the <span>slaved media elements</span> have newly <span>ended playback</span>.

<tbody>
<tr>
Expand Down

0 comments on commit fbdee45

Please sign in to comment.