Skip to content
Permalink
Browse files

[gw] (2) Add the autobuffer='' attribute as a hint to browsers.

git-svn-id: http://svn.whatwg.org/webapps@2855 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
Hixie committed Feb 23, 2009
1 parent a397b66 commit 98924a0bd3c47d640916d10a49a1adf64ece1485
Showing with 81 additions and 3 deletions.
  1. +37 −3 index
  2. +44 −0 source
40 index
<dd><a href=#global-attributes>Global attributes</a></dd>
<dd><code title=attr-media-src><a href=#attr-media-src>src</a></code></dd>
<dd><code title=attr-video-poster><a href=#attr-video-poster>poster</a></code></dd>
<dd><code title=attr-media-autobuffer><a href=#attr-media-autobuffer>autobuffer</a></code></dd>
<dd><code title=attr-media-autoplay><a href=#attr-media-autoplay>autoplay</a></code></dd>
<dd><code title=attr-media-loop><a href=#attr-media-loop>loop</a></code></dd>
<dd><code title=attr-media-controls><a href=#attr-media-controls>controls</a></code></dd>
whose <a href=#media-data>media data</a> is ostensibly video data, possibly
with associated audio data.</p>

<p>The <code title=attr-media-src><a href=#attr-media-src>src</a></code>, <code title=attr-media-autoplay><a href=#attr-media-autoplay>autoplay</a></code>, <code title=attr-media-loop><a href=#attr-media-loop>loop</a></code>, and <code title=attr-media-controls><a href=#attr-media-controls>controls</a></code> attributes are <a href=#media-element-attributes title="media element attributes">the attributes common to all media
<p>The <code title=attr-media-src><a href=#attr-media-src>src</a></code>, <code title=attr-media-autobuffer><a href=#attr-media-autobuffer>autobuffer</a></code>, <code title=attr-media-autoplay><a href=#attr-media-autoplay>autoplay</a></code>, <code title=attr-media-loop><a href=#attr-media-loop>loop</a></code>, and <code title=attr-media-controls><a href=#attr-media-controls>controls</a></code> attributes are <a href=#media-element-attributes title="media element attributes">the attributes common to all media
elements</a>.</p>

<p>The <dfn id=attr-video-poster title=attr-video-poster><code>poster</code></dfn>
<dt>Content attributes:</dt>
<dd><a href=#global-attributes>Global attributes</a></dd>
<dd><code title=attr-media-src><a href=#attr-media-src>src</a></code></dd>
<dd><code title=attr-media-autobuffer><a href=#attr-media-autobuffer>autobuffer</a></code></dd>
<dd><code title=attr-media-autoplay><a href=#attr-media-autoplay>autoplay</a></code></dd>
<dd><code title=attr-media-loop><a href=#attr-media-loop>loop</a></code></dd>
<dd><code title=attr-media-controls><a href=#attr-media-controls>controls</a></code></dd>
<p>The <code><a href=#audio>audio</a></code> element is a <a href=#media-element>media element</a>
whose <a href=#media-data>media data</a> is ostensibly audio data.</p>

<p>The <code title=attr-media-src><a href=#attr-media-src>src</a></code>, <code title=attr-media-autoplay><a href=#attr-media-autoplay>autoplay</a></code>, <code title=attr-media-loop><a href=#attr-media-loop>loop</a></code>, and <code title=attr-media-controls><a href=#attr-media-controls>controls</a></code> attributes are <a href=#media-element-attributes title="media element attributes">the attributes common to all media
<p>The <code title=attr-media-src><a href=#attr-media-src>src</a></code>, <code title=attr-media-autobuffer><a href=#attr-media-autobuffer>autobuffer</a></code>, <code title=attr-media-autoplay><a href=#attr-media-autoplay>autoplay</a></code>, <code title=attr-media-loop><a href=#attr-media-loop>loop</a></code>, and <code title=attr-media-controls><a href=#attr-media-controls>controls</a></code> attributes are <a href=#media-element-attributes title="media element attributes">the attributes common to all media
elements</a>.</p>

<p>When an <code><a href=#audio>audio</a></code> element is <a href=#potentially-playing>potentially
const unsigned short <a href=#dom-media-network_loaded title=dom-media-NETWORK_LOADED>NETWORK_LOADED</a> = 3;
const unsigned short <a href=#dom-media-network_no_source title=dom-media-NETWORK_NO_SOURCE>NETWORK_NO_SOURCE</a> = 4;
readonly attribute unsigned short <a href=#dom-media-networkstate title=dom-media-networkState>networkState</a>;
attribute boolean <a href=#dom-media-autobuffer title=dom-media-autobuffer>autobuffer</a>;
readonly attribute float <a href=#dom-media-bufferingrate title=dom-media-bufferingRate>bufferingRate</a>;
readonly attribute boolean <a href=#dom-media-bufferingthrottled title=dom-media-bufferingThrottled>bufferingThrottled</a>;
readonly attribute <a href=#timeranges>TimeRanges</a> <a href=#dom-media-buffered title=dom-media-buffered>buffered</a>;
void <span title=dom-CueRangeCallback-handleEvent>handleEvent</span>(in DOMString id);
};</pre>

<p>The <dfn id=media-element-attributes>media element attributes</dfn>, <code title=attr-media-src><a href=#attr-media-src>src</a></code>, <code title=attr-media-autoplay><a href=#attr-media-autoplay>autoplay</a></code>, <code title=attr-media-loop><a href=#attr-media-loop>loop</a></code>, and <code title=attr-media-controls><a href=#attr-media-controls>controls</a></code>, apply to all <a href=#media-element title="media element">media elements</a>. They are defined in
<p>The <dfn id=media-element-attributes>media element attributes</dfn>, <code title=attr-media-src><a href=#attr-media-src>src</a></code>, <code title=attr-media-autobuffer><a href=#attr-media-autobuffer>autobuffer</a></code>, <code title=attr-media-autoplay><a href=#attr-media-autoplay>autoplay</a></code>, <code title=attr-media-loop><a href=#attr-media-loop>loop</a></code>, and <code title=attr-media-controls><a href=#attr-media-controls>controls</a></code>, apply to all <a href=#media-element title="media element">media elements</a>. They are defined in
this section.</p>

<!-- proposed v2 (actually v3!) features:
element. If and when downloading of the resource resumes, the
user agent must set the <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> to <code title=dom-media-NETWORK_LOADING><a href=#dom-media-network_loading>NETWORK_LOADING</a></code>.</p>

<p>The <code title=attr-media-autobuffer><a href=#attr-media-autobuffer>autobuffer</a></code>
attribute provides a hint that the author expects that downloading
the entire resource optimistically will be worth it, even in the
absence of the <code title=attr-media-autoplay><a href=#attr-media-autoplay>autoplay</a></code>
attribute. In the absence of either attribute, the user agent is
likely to find that waiting until the user starts playback before
downloading any further content leads to a more efficient use of
the network resources.</p>

<p>The user agent may use whatever means necessary to fetch the
resource (within the constraints put forward by this and other
specifications); for example, reconnecting to the server in the
flag</a> to false. This stops <a href=#delay-the-load-event title="delay the load
event">delaying the load event</a>.</li>

<li><p class=note>This is the point at which a user agent
that is attempting to reduce network usage while still fetching
the metadata for each <a href=#media-resource>media resource</a> would stop
buffering, causing the <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> attribute to
switch to the <code title=dom-media-NETWORK_IDLE><a href=#dom-media-network_idle>NETWORK_IDLE</a></code> value, if
the <a href=#media-element>media element</a> did not have an <code title=attr-media-autobuffer><a href=#attr-media-autobuffer>autobuffer</a></code> or <code title=attr-media-autoplay><a href=#attr-media-autoplay>autoplay</a></code> attribute.</li>

</ol><p class=note>The user agent is <em>required</em> to
determine the duration of the <a href=#media-resource>media resource</a> and
go through this step before playing.</p> <!-- actually defined
document</a>, the user agent must asynchronously invoke the
<a href=#media-element>media element</a>'s <a href=#concept-media-load-algorithm title=concept-media-load-algorithm>load algorithm</a>.</p>

<p>The <dfn id=attr-media-autobuffer title=attr-media-autobuffer><code>autobuffer</code></dfn>
attribute is a <a href=#boolean-attribute>boolean attribute</a>. Its presence hints to
the user agent that the author believes that the <a href=#media-element>media
element</a> will likely be used, even though the element does not
have an <code title=attr-media-autoplay><a href=#attr-media-autoplay>autoplay</a></code>
attribute. (The attribute has no effect if used in conjunction with
the <code title=attr-media-autoplay><a href=#attr-media-autoplay>autoplay</a></code> attribute,
though including both is not an error.) This attribute may be
ignored altogether. The attribute must be ignored if the <code title=attr-media-autoplay><a href=#attr-media-autoplay>autoplay</a></code> attribute is
present.</p>

<p>The <dfn id=dom-media-autobuffer title=dom-media-autobuffer><code>autobuffer</code></dfn> DOM
attribute must <a href=#reflect>reflect</a> the content attribute of the
same name.</p>

<p>The <dfn id=dom-media-bufferingrate title=dom-media-bufferingRate><code>bufferingRate</code></dfn>
attribute must return the average number of bits received per second
for the current download over the past few seconds. If there is no
44 source
<dd><span>Global attributes</span></dd>
<dd><code title="attr-media-src">src</code></dd>
<dd><code title="attr-video-poster">poster</code></dd>
<dd><code title="attr-media-autobuffer">autobuffer</code></dd>
<dd><code title="attr-media-autoplay">autoplay</code></dd>
<dd><code title="attr-media-loop">loop</code></dd>
<dd><code title="attr-media-controls">controls</code></dd>
with associated audio data.</p>

<p>The <code title="attr-media-src">src</code>, <code
title="attr-media-autobuffer">autobuffer</code>, <code
title="attr-media-autoplay">autoplay</code>, <code
title="attr-media-loop">loop</code>, and <code
title="attr-media-controls">controls</code> attributes are <span
<dt>Content attributes:</dt>
<dd><span>Global attributes</span></dd>
<dd><code title="attr-media-src">src</code></dd>
<dd><code title="attr-media-autobuffer">autobuffer</code></dd>
<dd><code title="attr-media-autoplay">autoplay</code></dd>
<dd><code title="attr-media-loop">loop</code></dd>
<dd><code title="attr-media-controls">controls</code></dd>
whose <span>media data</span> is ostensibly audio data.</p>

<p>The <code title="attr-media-src">src</code>, <code
title="attr-media-autobuffer">autobuffer</code>, <code
title="attr-media-autoplay">autoplay</code>, <code
title="attr-media-loop">loop</code>, and <code
title="attr-media-controls">controls</code> attributes are <span
const unsigned short <span title="dom-media-NETWORK_LOADED">NETWORK_LOADED</span> = 3;
const unsigned short <span title="dom-media-NETWORK_NO_SOURCE">NETWORK_NO_SOURCE</span> = 4;
readonly attribute unsigned short <span title="dom-media-networkState">networkState</span>;
attribute boolean <span title="dom-media-autobuffer">autobuffer</span>;
readonly attribute float <span title="dom-media-bufferingRate">bufferingRate</span>;
readonly attribute boolean <span title="dom-media-bufferingThrottled">bufferingThrottled</span>;
readonly attribute <span>TimeRanges</span> <span title="dom-media-buffered">buffered</span>;

<p>The <dfn>media element attributes</dfn>, <code
title="attr-media-src">src</code>, <code
title="attr-media-autobuffer">autobuffer</code>, <code
title="attr-media-autoplay">autoplay</code>, <code
title="attr-media-loop">loop</code>, and <code
title="attr-media-controls">controls</code>, apply to all <span
title="dom-media-networkState">networkState</code> to <code
title="dom-media-NETWORK_LOADING">NETWORK_LOADING</code>.</p>

<p>The <code title="attr-media-autobuffer">autobuffer</code>
attribute provides a hint that the author expects that downloading
the entire resource optimistically will be worth it, even in the
absence of the <code title="attr-media-autoplay">autoplay</code>
attribute. In the absence of either attribute, the user agent is
likely to find that waiting until the user starts playback before
downloading any further content leads to a more efficient use of
the network resources.</p>

<p>The user agent may use whatever means necessary to fetch the
resource (within the constraints put forward by this and other
specifications); for example, reconnecting to the server in the
flag</span> to false. This stops <span title="delay the load
event">delaying the load event</span>.</p></li>

<li><p class="note">This is the point at which a user agent
that is attempting to reduce network usage while still fetching
the metadata for each <span>media resource</span> would stop
buffering, causing the <code
title="dom-media-networkState">networkState</code> attribute to
switch to the <code
title="dom-media-NETWORK_IDLE">NETWORK_IDLE</code> value, if
the <span>media element</span> did not have an <code
title="attr-media-autobuffer">autobuffer</code> or <code
title="attr-media-autoplay">autoplay</code> attribute.</p></li>

</ol>

<p class="note">The user agent is <em>required</em> to
<span>media element</span>'s <span
title="concept-media-load-algorithm">load algorithm</span>.</p>

<p>The <dfn
title="attr-media-autobuffer"><code>autobuffer</code></dfn>
attribute is a <span>boolean attribute</span>. Its presence hints to
the user agent that the author believes that the <span>media
element</span> will likely be used, even though the element does not
have an <code title="attr-media-autoplay">autoplay</code>
attribute. (The attribute has no effect if used in conjunction with
the <code title="attr-media-autoplay">autoplay</code> attribute,
though including both is not an error.) This attribute may be
ignored altogether. The attribute must be ignored if the <code
title="attr-media-autoplay">autoplay</code> attribute is
present.</p>

<p>The <dfn
title="dom-media-autobuffer"><code>autobuffer</code></dfn> DOM
attribute must <span>reflect</span> the content attribute of the
same name.</p>

<p>The <dfn
title="dom-media-bufferingRate"><code>bufferingRate</code></dfn>
attribute must return the average number of bits received per second

0 comments on commit 98924a0

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