Skip to content
Permalink
Browse files

[giow] (2) When a media element ends, pause it. Same for MediaControl…

…lers. Also a bunch of minor editorial tweaks.

Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=12559

git-svn-id: http://svn.whatwg.org/webapps@6562 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
Hixie committed Sep 22, 2011
1 parent 69f4aa7 commit 3fb847f13751b1645e7f109428fdc04a89591dfd
Showing with 183 additions and 115 deletions.
  1. +58 −36 complete.html
  2. +58 −36 index
  3. +67 −43 source
@@ -28446,9 +28446,10 @@ <h5 id=playing-the-media-resource><span class=secno>4.8.10.8 </span>Playing the
</ul></li>

</ul><p>The <dfn id=dom-media-ended title=dom-media-ended><code>ended</code></dfn>
attribute must return true if the <a href=#media-element>media element</a> has
attribute must return true if, the last time the <a href=#event-loop>event
loop</a> reached step 1, the <a href=#media-element>media element</a> had
<a href=#ended-playback>ended playback</a> and the <a href=#direction-of-playback>direction of
playback</a> is forwards, and false otherwise.</p>
playback</a> was forwards, and false otherwise.</p>

<p>A <a href=#media-element>media element</a> is said to have <dfn id=stopped-due-to-errors>stopped due to
errors</dfn> when the element's <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> attribute is <code title=dom-media-HAVE_METADATA><a href=#dom-media-have_metadata>HAVE_METADATA</a></code> or greater, and
@@ -28467,7 +28468,7 @@ <h5 id=playing-the-media-resource><span class=secno>4.8.10.8 </span>Playing the
If the <a href=#media-element>media element</a> has a <a href=#current-media-controller>current media
controller</a> when this happens, then the user agent must
<a href=#report-the-controller-state>report the controller state</a> for the <a href=#media-element>media
element</a>'s <a href=#current-media-controller>current media controller</a>. If If the
element</a>'s <a href=#current-media-controller>current media controller</a>. If the
<a href=#media-element>media element</a> has a <a href=#current-media-controller>current media
controller</a> when the user makes a selection, allowing playback
to resume, the user agent must similarly <a href=#report-the-controller-state>report the controller
@@ -28506,29 +28507,36 @@ <h5 id=playing-the-media-resource><span class=secno>4.8.10.8 </span>Playing the
inexplicable (since the normally matching 'ended' given below event
doesn't fire in the loop case). -->

<li><p>Stop playback.<p class=note>The <code title=dom-media-ended><a href=#dom-media-ended>ended</a></code> attribute becomes
true.</li>
<li><p>As defined above, the <code title=dom-media-ended><a href=#dom-media-ended>ended</a></code> IDL attribute starts returning
true once the <a href=#event-loop>event loop</a>'s current <a href=#concept-task title=concept-task>task</a> ends.</li>

<li><p>The user agent must <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire
a simple event</a> named <code title=event-media-timeupdate><a href=#event-media-timeupdate>timeupdate</a></code> at the
element.</li>
<li><p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-simple-event>fire a simple
event</a> named <code title=event-media-timeupdate><a href=#event-media-timeupdate>timeupdate</a></code> at the <a href=#media-element>media
element</a>.</li>

<li><p>The user agent must <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire
a simple event</a> named <code title=event-media-ended><a href=#event-media-ended>ended</a></code>
at the element.</li>
<li><p><a href=#queue-a-task>Queue a task</a> that, if the <a href=#media-element>media
element</a> does not have a <a href=#current-media-controller>current media
controller</a>, and the <a href=#media-element>media element</a> has still
<a href=#ended-playback>ended playback</a>, and the <a href=#direction-of-playback>direction of
playback</a> is still forwards, and <a href=#dom-media-paused title=dom-media-paused>paused</a> is false, changes <a href=#dom-media-paused title=dom-media-paused>paused</a> to true and <a href=#fire-a-simple-event title="fire a simple event">fires a simple event</a> named <code title=event-media-pause><a href=#event-media-pause>pause</a></code> at the <a href=#media-element>media
element</a>.</li>

<li><p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-simple-event>fire a simple
event</a> named <code title=event-media-ended><a href=#event-media-ended>ended</a></code> at
the <a href=#media-element>media element</a>.</li>

<li><p>If the <a href=#media-element>media element</a> has a <a href=#current-media-controller>current media
controller</a>, then <a href=#report-the-controller-state>report the controller state</a>
for the <a href=#media-element>media element</a>'s <a href=#current-media-controller>current media
controller</a>.</li>

</ol><p>When the <a href=#current-playback-position>current playback position</a> reaches the
<a href=#earliest-possible-position>earliest possible position</a> of the <a href=#media-resource>media
resource</a> when the <a href=#direction-of-playback>direction of playback</a> is
backwards, then the user agent must follow these steps:</p>

<ol><li><p>Stop playback.</li>
backwards, then the user agent must only <a href=#queue-a-task>queue a task</a>
to <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-media-timeupdate><a href=#event-media-timeupdate>timeupdate</a></code> at the element.</p>

<li><p>The user agent must <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire
a simple event</a> named <code title=event-media-timeupdate><a href=#event-media-timeupdate>timeupdate</a></code> at the
element.</li>

</ol><hr><p>The <dfn id=dom-media-defaultplaybackrate title=dom-media-defaultPlaybackRate><code>defaultPlaybackRate</code></dfn>
<hr><p>The <dfn id=dom-media-defaultplaybackrate title=dom-media-defaultPlaybackRate><code>defaultPlaybackRate</code></dfn>
attribute gives the desired speed at which the <a href=#media-resource>media
resource</a> is to play, as a multiple of its intrinsic
speed. The attribute is mutable: on getting it must return the last
@@ -29751,31 +29759,31 @@ <h6 id=media-controllers><span class=secno>4.8.10.11.2 </span>Media controllers<

</dd>

<dt><var title="">controller</var> . <code title=dom-MediaController-played><a href=#dom-mediacontroller-played>played</a></code></dt>
<dt><var title="">controller</var> . <code title=dom-MediaController-play><a href=#dom-mediacontroller-play>play</a></code>()</dt>

<dd>

<p>Returns a <code><a href=#timeranges>TimeRanges</a></code> object that represents the
union of the time ranges in all the slaved <a href=#media-element title="media
element">media elements</a> that have been played.</p>
<p>Sets the <code title=dom-MediaController-paused><a href=#dom-mediacontroller-paused>paused</a></code>
attribute to false.</p>

</dd>

<dt><var title="">controller</var> . <code title=dom-MediaController-play><a href=#dom-mediacontroller-play>play</a></code>()</dt>
<dt><var title="">controller</var> . <code title=dom-MediaController-pause><a href=#dom-mediacontroller-pause>pause</a></code>()</dt>

<dd>

<p>Sets the <code title=dom-MediaController-paused><a href=#dom-mediacontroller-paused>paused</a></code>
attribute to false.</p>
attribute to true.</p>

</dd>

<dt><var title="">controller</var> . <code title=dom-MediaController-pause><a href=#dom-mediacontroller-pause>pause</a></code>()</dt>
<dt><var title="">controller</var> . <code title=dom-MediaController-played><a href=#dom-mediacontroller-played>played</a></code></dt>

<dd>

<p>Sets the <code title=dom-MediaController-paused><a href=#dom-mediacontroller-paused>paused</a></code>
attribute to true.</p>
<p>Returns a <code><a href=#timeranges>TimeRanges</a></code> object that represents the
union of the time ranges in all the slaved <a href=#media-element title="media
element">media elements</a> that have been played.</p>

</dd>

@@ -29921,14 +29929,6 @@ <h6 id=media-controllers><span class=secno>4.8.10.11.2 </span>Media controllers<
object is a <a href=#paused-media-controller>paused media controller</a>, and false
otherwise.</p>

<p>The <dfn id=dom-mediacontroller-played title=dom-MediaController-played><code>played</code></dfn>
attribute must return a new static <a href=#normalized-timeranges-object>normalized
<code>TimeRanges</code> object</a> that represents the union of
the ranges of the <a href=#media-resource title="media resource">media
resources</a> of the <a href=#slaved-media-elements>slaved media elements</a> that the
user agent has so far rendered, at the time the attribute is
evaluated.</p>

<p>When the <dfn id=dom-mediacontroller-pause title=dom-MediaController-pause><code>pause()</code></dfn> method
is invoked, if the <code><a href=#mediacontroller>MediaController</a></code> is a <a href=#playing-media-controller>playing
media controller</a> then the user agent must change the
@@ -29947,6 +29947,14 @@ <h6 id=media-controllers><span class=secno>4.8.10.11.2 </span>Media controllers<
<code><a href=#mediacontroller>MediaController</a></code>, and then <a href=#report-the-controller-state>report the controller
state</a> of the <code><a href=#mediacontroller>MediaController</a></code>.</p>

<p>The <dfn id=dom-mediacontroller-played title=dom-MediaController-played><code>played</code></dfn>
attribute must return a new static <a href=#normalized-timeranges-object>normalized
<code>TimeRanges</code> object</a> that represents the union of
the ranges of the <a href=#media-resource title="media resource">media
resources</a> of the <a href=#slaved-media-elements>slaved media elements</a> that the
user agent has so far rendered, at the time the attribute is
evaluated.</p>

<hr><p>A <code><a href=#mediacontroller>MediaController</a></code> has a <dfn id=media-controller-default-playback-rate>media controller
default playback rate</dfn> and a <dfn id=media-controller-playback-rate>media controller playback
rate</dfn>, which must both be set to 1.0 when the
@@ -30204,6 +30212,20 @@ <h6 id=media-controllers><span class=secno>4.8.10.11.2 </span>Media controllers<

</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> and the <var title="">new playback state</var>
is <i>ended</i>, then <a href=#queue-a-task>queue a task</a> that, if the
<code><a href=#mediacontroller>MediaController</a></code> object is a <a href=#playing-media-controller>playing media
controller</a>, and all of the <code><a href=#mediacontroller>MediaController</a></code>'s
<a href=#slaved-media-elements>slaved media elements</a> have still <a href=#ended-playback>ended
playback</a>, and the <a href=#media-controller-playback-rate>media controller playback
rate</a> is still positive or zero, changes the
<code><a href=#mediacontroller>MediaController</a></code> object to a <a href=#paused-media-controller>paused media
controller</a> and then <a href=#fire-a-simple-event title="fire a simple event">fires
a simple event</a> named <code title=event-MediaController-pause><a href=#event-mediacontroller-pause>pause</a></code> at the
<code><a href=#mediacontroller>MediaController</a></code> object.</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

0 comments on commit 3fb847f

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