Skip to content
Permalink
Browse files

[gw] (2) Avoid firing 'canplay' twice if media buffers slowly. Also, …

…what's this about a 'prevous' ready state...?

git-svn-id: http://svn.whatwg.org/webapps@2848 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
Hixie committed Feb 22, 2009
1 parent c386f6f commit c4c266fc8d65c1ced14b757cc306bf7ac6309418
Showing with 20 additions and 13 deletions.
  1. +9 −6 index
  2. +11 −7 source
15 index
</dl><p>When the ready state of a <a href=#media-element>media element</a> whose <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> is not <code title=dom-media-NETWORK_EMPTY><a href=#dom-media-network_empty>NETWORK_EMPTY</a></code> changes, the
user agent must follow the steps given below:</p>

<dl class=switch><!-- going up to metadata --><dt>If the prevous ready state was <code title=dom-media-HAVE_NOTHING><a href=#dom-media-have_nothing>HAVE_NOTHING</a></code>, and the new
<dl class=switch><!-- going up to metadata --><dt>If the previous ready state was <code title=dom-media-HAVE_NOTHING><a href=#dom-media-have_nothing>HAVE_NOTHING</a></code>, and the new
ready state is <code title=dom-media-HAVE_METADATA><a href=#dom-media-have_metadata>HAVE_METADATA</a></code></dt>

<dd>

<!-- going up to current for the first time -->

<dt id=handling-first-frame-available>If the prevous ready state
<dt id=handling-first-frame-available>If the previous ready state
was <code title=dom-media-HAVE_METADATA><a href=#dom-media-have_metadata>HAVE_METADATA</a></code> and
the new ready state is <code title=dom-media-HAVE_CURRENT_DATA><a href=#dom-media-have_current_data>HAVE_CURRENT_DATA</a></code></dt>

</dd>

<!-- going down -->
<dt>If the prevous ready state was <code title=dom-media-HAVE_FUTURE_DATA><a href=#dom-media-have_future_data>HAVE_FUTURE_DATA</a></code> or more,
<dt>If the previous ready state was <code title=dom-media-HAVE_FUTURE_DATA><a href=#dom-media-have_future_data>HAVE_FUTURE_DATA</a></code> or more,
and the new ready state is <code title=dom-media-HAVE_CURRENT_DATA><a href=#dom-media-have_current_data>HAVE_CURRENT_DATA</a></code> or
less</dt>

</dd>

<!-- going up to future -->
<dt>If the prevous ready state was <code title=dom-media-HAVE_CURRENT_DATA><a href=#dom-media-have_current_data>HAVE_CURRENT_DATA</a></code> or
<dt>If the previous ready state was <code title=dom-media-HAVE_CURRENT_DATA><a href=#dom-media-have_current_data>HAVE_CURRENT_DATA</a></code> or
less, and the new ready state is <code title=dom-media-HAVE_FUTURE_DATA><a href=#dom-media-have_future_data>HAVE_FUTURE_DATA</a></code></dt>

<dd>

<dd>

<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> called <code title=event-canplay><a href=#event-canplay>canplay</a></code>, and then <a href=#queue-a-task>queue a
<p>If the previous ready state was <code title=dom-media-HAVE_CURRENT_DATA><a href=#dom-media-have_current_data>HAVE_CURRENT_DATA</a></code> or
less, 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> called <code title=event-canplay><a href=#event-canplay>canplay</a></code>.</p>

<p>In either case, the user agent must then <a href=#queue-a-task>queue a
task</a> to <a href=#fire-a-simple-event>fire a simple event</a> called <code title=event-canplaythrough><a href=#event-canplaythrough>canplaythrough</a></code>.</p>

<p>If the <a href=#autoplaying-flag>autoplaying flag</a> is true, and the <code title=dom-media-paused><a href=#dom-media-paused>paused</a></code> attribute is true, and the
18 source
<dl class="switch">

<!-- going up to metadata -->
<dt>If the prevous ready state was <code
<dt>If the previous ready state was <code
title="dom-media-HAVE_NOTHING">HAVE_NOTHING</code>, and the new
ready state is <code
title="dom-media-HAVE_METADATA">HAVE_METADATA</code></dt>

<!-- going up to current for the first time -->

<dt id="handling-first-frame-available">If the prevous ready state
<dt id="handling-first-frame-available">If the previous ready state
was <code title="dom-media-HAVE_METADATA">HAVE_METADATA</code> and
the new ready state is <code
title="dom-media-HAVE_CURRENT_DATA">HAVE_CURRENT_DATA</code></dt>
</dd>

<!-- going down -->
<dt>If the prevous ready state was <code
<dt>If the previous ready state was <code
title="dom-media-HAVE_FUTURE_DATA">HAVE_FUTURE_DATA</code> or more,
and the new ready state is <code
title="dom-media-HAVE_CURRENT_DATA">HAVE_CURRENT_DATA</code> or
</dd>

<!-- going up to future -->
<dt>If the prevous ready state was <code
<dt>If the previous 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>, and then <span>queue a
<p>If the previous ready state was <code
title="dom-media-HAVE_CURRENT_DATA">HAVE_CURRENT_DATA</code> or
less, 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>In either case, the user agent must then <span>queue a
task</span> to <span>fire a simple event</span> called <code
title="event-canplaythrough">canplaythrough</code>.</p>

0 comments on commit c4c266f

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