Skip to content
Permalink
Browse files

[giow] (0) Add an 'ended' event to MediaController.

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 fbdee4570fcb84c9fe2c0646e9da89521d1cafc0
Showing with 108 additions and 20 deletions.
  1. +34 −7 complete.html
  2. +34 −7 index
  3. +40 −6 source

<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>-->
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
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
<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>
41 index

<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>-->
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
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
<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>
46 source
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
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>

<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>

0 comments on commit fbdee45

Please sign in to comment.
You can’t perform that action at this time.