HTML Standard Tracker

Filter

File a bug

SVNBugCommentTime (UTC)
2498[Gecko] [Opera] [Webkit] New plan. Introduce a 'playing' event for when the playback actually begins.2008-12-01 12:31
@@ -19292,23 +19292,32 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
     depending on the current state of playback.</p>
 
    </dd>
 
    <!-- going up to future -->
    <dt>If the prevous ready state was <code
    title="dom-media-HAVE_CURRENT_DATA">HAVE_CURRENT_DATA</code> or
    less, and the new ready state is <code
    title="dom-media-HAVE_FUTURE_DATA">HAVE_FUTURE_DATA</code></dt>
 
-   <dd><p>The user agent must <span>queue a task</span> to
-   <span>fire a simple event</span> called <code
-   title="event-canplay">canplay</code>.</p></dd>
+   <dd>
+
+    <p>The user agent must <span>queue a task</span> to <span>fire a
+    simple event</span> called <code
+    title="event-canplay">canplay</code>.</p>
+
+    <p>If the element is <span>potentially playing</span>, the user
+    agent must <span>queue a task</span> to <span>fire a simple
+    event</span> called <code
+    title="event-playing">playing</code>.</p>
+
+   </dd>
 
    <!-- going up to enough -->
    <dt>If the new ready state is <code
    title="dom-media-HAVE_ENOUGH_DATA">HAVE_ENOUGH_DATA</code></dt>
 
    <dd>
 
     <p>The user agent must <span>queue a task</span> to <span>fire a
     simple event</span> called <code
     title="event-canplay">canplay</code>, and then <span>queue a
@@ -19324,20 +19333,27 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
     <span>queue a task</span> to <span>fire a simple event</span>
     called <code title="event-play">play</code>.</p>
 
     <p class="note">User agents are not required to autoplay, and it
     is suggested that user agents honor user preferences on the
     matter. Authors are urged to use the <code
     title="attr-media-autoplay">autoplay</code> attribute rather than
     using script to force the video to play, so as to allow the user
     to override the behavior if so desired.</p>
 
+    <p>If the element is now <span>potentially playing</span>, and the
+    previous ready state was not <code
+    title="dom-media-HAVE_FUTURE_DATA">HAVE_FUTURE_DATA</code>, the
+    user agent must <span>queue a task</span> to <span>fire a simple
+    event</span> called <code
+    title="event-playing">playing</code>.</p>
+
    </dd>
 
   </dl>
 
   <p class="note">It is possible for the ready state of a media
   element to jump between these states discontinuously. For example,
   the state of a media element can jump straight from <code
   title="dom-media-HAVE_METADATA">HAVE_METADATA</code> to <code
   title="dom-media-HAVE_ENOUGH_DATA">HAVE_ENOUGH_DATA</code> without
   passing through the <code
@@ -19607,30 +19623,46 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
 
    </li>
 
    <li>
 
     <p>If the <span>media element</span>'s <code
     title="dom-media-paused">paused</code> attribute is true, it must
     be set to false.</p>
 
     <p>If this changed the value of <code
-    title="dom-media-paused">paused</code>, the user agent must
-    <span>queue a task</span> to <span>fire a simple event</span>
-    called <code title="event-play">play</code> at the element; if, in
-    addition, the <span>media element</span>'s <code
-    title="dom-media-readyState">readyState</code> attribute has a
-    value lower than <code
-    title="dom-media-HAVE_FUTURE_DATA">HAVE_FUTURE_DATA</code>, the
-    user agent must also <span>queue a task</span> to <span>fire a
-    simple event</span> called <code
-    title="event-waiting">waiting</code> at the element.</p>
+    title="dom-media-paused">paused</code>, the user agent must run the following substeps:</p>
+
+    <ol>
+
+     <li><p><span>Queue a task</span> to <span>fire a simple event</span>
+     called <code title="event-play">play</code> at the element.</p></li>
+
+     <li><p>If the <span>media element</span>'s <code
+     title="dom-media-readyState">readyState</code> attribute has the
+     value <code title="dom-media-HAVE_METADATA">HAVE_METADATA</code>
+     or <code
+     title="dom-media-HAVE_CURRENT_DATA">HAVE_CURRENT_DATA</code>,
+     <span>queue a task</span> to <span>fire a simple event</span>
+     called <code title="event-waiting">waiting</code> at the
+     element.</p></li>
+
+     <li><p>Otherwise, the <span>media element</span>'s <code
+     title="dom-media-readyState">readyState</code> attribute has the value
+     <code title="dom-media-HAVE_FUTURE_DATA">HAVE_FUTURE_DATA</code>
+     or <code
+     title="dom-media-HAVE_ENOUGH_DATA">HAVE_ENOUGH_DATA</code>;
+     <span>queue a task</span> to <span>fire a simple event</span>
+     called <code title="event-playing">playing</code> at the
+     element.</p></li>
+
+    </ol>
 
    </li>
 
    <li><p>The <span>media element</span>'s <span>autoplaying
    flag</span> must be set to false.</p></li>
 
    <li><p>The method must then return.</p></li>
 
   </ol>
 
@@ -19745,31 +19777,29 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
    element.</p></li>
 
    <li><p>If none of the <span title="cue range">cue ranges</span> in
    <var title="">current ranges</var> have their "active" boolean set
    to "false" (inactive) and none of the <span title="cue range">cue
    ranges</span> in <var title="">other ranges</var> have their
    "active" boolean set to "true" (active), then abort these
    steps.</p></li>
 
    <li><p>If the time was reached through the usual monotonic increase
-   of the current playback position during normal playback, and if
-   either the user agent has not fired a <code
+   of the current playback position during normal playback, and if the
+   user agent has not fired a <code
    title="event-timeupdate">timeupdate</code> event at the element in
-   the past 15 to 250ms, or there has been an instant since the last
-   time such an event was fired that the element was not
-   <span>potentially playing</span>, then 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. (In the other cases, such as explicit seeks, relevant
-   events get fired as part of the overall process of changing the
-   current playback position.)</p>
+   the past 15 to 250ms, then 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. (In the
+   other cases, such as explicit seeks, relevant events get fired as
+   part of the overall process of changing the current playback
+   position.)</p>
 
    <p class="note">The event thus is not to be fired faster than about
    66Hz or slower than 4Hz. User agents are encouraged to vary the
    frequency of the event based on the system load and the average
    cost of processing the event each time, so that the UI updates are
    not any more frequent than the user agent can comfortably handle
    while decoding the video.</p></li>
 
    <li><p>If the time was reached through the usual monotonic increase
    of the current playback position during normal playback, and there
@@ -20113,21 +20143,21 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
     <tr>
      <td><dfn title="event-stalled"><code>stalled</code></dfn>
      <td><code>ProgressEvent</code>
      <td>The user agent is trying to fetch <span>media data</span>, but data is unexpectedly not forthcoming.
      <td><code title="dom-media-networkState">networkState</code> is <code title="dom-media-NETWORK_LOADING">NETWORK_LOADING</code>.
 
    <tbody>
     <tr>
      <td><dfn title="event-play"><code>play</code></dfn>
      <td><code>Event</code>
-     <td>Playback has begun. Fired after the <code title="dom-media-play">play</code> method has returned.
+     <td>Playback has begun. Fired after the <code title="dom-media-play">play()</code> method has returned.
      <td><code title="dom-media-paused">paused</code> is newly false.
     <tr>
      <td><dfn title="event-pause"><code>pause</code></dfn>
      <td><code>Event</code>
      <td>Playback has been paused. Fired after the <code title="dom-media-pause">pause</code> method has returned.
      <td><code title="dom-media-paused">paused</code> is newly true.
 
    <tbody>
     <tr>
      <td><dfn title="event-loadedmetadata"><code>loadedmetadata</code></dfn>
@@ -20138,20 +20168,25 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
      <td><dfn title="event-loadeddata"><code>loadeddata</code></dfn>
      <td><code>Event</code>
      <td>The user agent can render the <span>media data</span> at the <span>current playback position</span> for the first time.
      <td><code title="dom-media-readyState">readyState</code> newly increased to <code title="dom-media-HAVE_CURRENT_DATA">HAVE_CURRENT_DATA</code> or greater for the first time.
     <tr>
      <td><dfn title="event-waiting"><code>waiting</code></dfn>
      <td><code>Event</code>
      <td>Playback has stopped because the next frame is not available, but the user agent expects that frame to become available in due course.
      <td><code title="dom-media-readyState">readyState</code> is newly equal to or less than <code title="dom-media-HAVE_CURRENT_DATA">HAVE_CURRENT_DATA</code>, and <code title="dom-media-paused">paused</code> is false. Either <code title="dom-media-seeking">seeking</code> is true, or the <span>current playback position</span> is not contained in any of the ranges in <code title="dom-media-buffered">buffered</code>. It is possible for playback to stop for two other reasons without <code title="dom-media-paused">paused</code> being false, but those two reasons do not fire this event: maybe <span title="ended playback">playback ended</span>, or playback <span>stopped due to errors</span>.
     <tr>
+     <td><dfn title="event-playing"><code>playing</code></dfn>
+     <td><code>Event</code>
+     <td>Playback has started.
+     <td><code title="dom-media-readyState">readyState</code> is newly equal to or greater than <code title="dom-media-HAVE_FUTURE_DATA">HAVE_FUTURE_DATA</code>, <code title="dom-media-paused">paused</code> is false, <code title="dom-media-seeking">seeking</code> is false, or the <span>current playback position</span> is contained in one of the ranges in <code title="dom-media-buffered">buffered</code>.
+    <tr>
      <td><dfn title="event-canplay"><code>canplay</code></dfn>
      <td><code>Event</code>
      <td>The user agent can resume playback of the <span>media data</span>, but estimates that if playback were to be started now, the <span>media resource</span> could not be rendered at the current playback rate up to its end without having to stop for further buffering of content.
      <td><code title="dom-media-readyState">readyState</code> newly increased to <code title="dom-media-HAVE_FUTURE_DATA">HAVE_FUTURE_DATA</code> or greater.
     <tr>
      <td><dfn title="event-canplaythrough"><code>canplaythrough</code></dfn>
      <td><code>Event</code>
      <td>The user agent estimates that if playback were to be started now, the <span>media resource</span> could be rendered at the current playback rate all the way to its end without having to stop for further buffering.
      <td><code title="dom-media-readyState">readyState</code> is newly equal to <code title="dom-media-HAVE_ENOUGH_DATA">HAVE_ENOUGH_DATA</code>.
 

|