Skip to content

Commit

Permalink
[giow] (0) Allow TimeRanges to contain 'empty' ranges (not really emp…
Browse files Browse the repository at this point in the history
…ty, they contain one moment in time). Add some text admonishing implementations that don't allow one to seek arbitrarily when it's actually possible just inconvenient or slow.

Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=26847
Affected topics: Video and Audio

git-svn-id: https://svn.whatwg.org/webapps@8819 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Sep 24, 2014
1 parent 7b7cee2 commit 40c18d7
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 14 deletions.
26 changes: 21 additions & 5 deletions complete.html
Expand Up @@ -23949,12 +23949,25 @@ <h5 id=seeking>4.8.14.9 Seeking</h5>
sliding window on an infinite stream. This is the behavior seen with DVRs viewing live TV, for
instance.</p>

<p>User agents should adopt adopt a very liberal and optimistic view of what is seekable. User
agents should also buffer recent content where possible to enable seeking to be fast.</p>

<p class=example>For instance, consider a large video file served on an HTTP server without
support for HTTP Range requests. A browser <em>could</em> implement this by only buffering the
current frame and data obtained for subsequent frames, never allow seeking, except for seeking to
the very start by restarting the playback. However, this would be a poor implementation. A high
quality implementation would buffer the last few minutes of content (or more, if sufficient
storage space is available), allowing the user to jump back and rewatch something surprising
without any latency, and would in addition allow arbitrary seeking by reloading the file from the
start if necessary, which would be slower but still more convenient than having to literally
restart the video and watch it all the way through just to get to an earlier unbuffered spot.</p>

<p><a href=#media-resource id=seeking:media-resource-7>Media resources</a> might be internally scripted or
interactive. Thus, a <a href=#media-element id=seeking:media-element-4>media element</a> could play in a non-linear fashion. If this
happens, the user agent must act as if the algorithm for <a href=#dom-media-seek id=seeking:dom-media-seek-2>seeking</a> was used whenever the <a href=#current-playback-position id=seeking:current-playback-position-9>current playback position</a>
changes in a discontinuous fashion (so that the relevant events fire). If the <a href=#media-element id=seeking:media-element-5>media
element</a> has a <a href=#current-media-controller id=seeking:current-media-controller>current media controller</a>, then the user agent must <a href=#seek-the-media-controller id=seeking:seek-the-media-controller>seek
the media controller</a> appropriately instead. </p>
the media controller</a> appropriately instead.</p>



Expand Down Expand Up @@ -26507,10 +26520,13 @@ <h5 id=time-ranges>4.8.14.14 Time ranges</h5>
<p>When a <code id=time-ranges:timeranges-2><a href=#timeranges>TimeRanges</a></code> object is said to be a <dfn id=normalised-timeranges-object>normalised <code>TimeRanges</code>
object</dfn>, the ranges it represents must obey the following criteria:</p>

<ul><li>The start of a range must be greater than the end of all earlier ranges.<li>The start of a range must be less than the end of that same range.</ul>
<ul><li>The start of a range must be greater than the end of all earlier ranges.<li>The start of a range must be less than or equal to the end of that same range.</ul>

<p>In other words, the ranges in such an object are ordered, don't overlap, aren't empty, and
don't touch (adjacent ranges are folded into one bigger range).</p>
<p>In other words, the ranges in such an object are ordered, don't overlap, and don't touch
(adjacent ranges are folded into one bigger range). A range can be empty (referencing just a
single moment in time), e.g. to indicate that only one frame is currently buffered in the case
that the user agent has discarded the entire <a href=#media-resource id=time-ranges:media-resource>media resource</a> except for the current
frame, when a <a href=#media-element id=time-ranges:media-element>media element</a> is paused.</p>

<p>Ranges in a <code id=time-ranges:timeranges-3><a href=#timeranges>TimeRanges</a></code> object must be inclusive.</p>

Expand All @@ -26519,7 +26535,7 @@ <h5 id=time-ranges>4.8.14.14 Time ranges</h5>
zero would have a start equal to zero and an end equal to the duration of the timeline.</p>

<p>The timelines used by the objects returned by the <code id=time-ranges:dom-media-buffered><a href=#dom-media-buffered>buffered</a></code>, <code id=time-ranges:dom-media-seekable><a href=#dom-media-seekable>seekable</a></code> and
<code id=time-ranges:dom-media-played><a href=#dom-media-played>played</a></code> IDL attributes of <a href=#media-element id=time-ranges:media-element>media
<code id=time-ranges:dom-media-played><a href=#dom-media-played>played</a></code> IDL attributes of <a href=#media-element id=time-ranges:media-element-2>media
elements</a> must be that element's <a href=#media-timeline id=time-ranges:media-timeline>media timeline</a>.</p>


Expand Down
26 changes: 21 additions & 5 deletions index
Expand Up @@ -23949,12 +23949,25 @@ interface <dfn id=htmlmediaelement>HTMLMediaElement</dfn> : <a href=#htmlelement
sliding window on an infinite stream. This is the behavior seen with DVRs viewing live TV, for
instance.</p>

<p>User agents should adopt adopt a very liberal and optimistic view of what is seekable. User
agents should also buffer recent content where possible to enable seeking to be fast.</p>

<p class=example>For instance, consider a large video file served on an HTTP server without
support for HTTP Range requests. A browser <em>could</em> implement this by only buffering the
current frame and data obtained for subsequent frames, never allow seeking, except for seeking to
the very start by restarting the playback. However, this would be a poor implementation. A high
quality implementation would buffer the last few minutes of content (or more, if sufficient
storage space is available), allowing the user to jump back and rewatch something surprising
without any latency, and would in addition allow arbitrary seeking by reloading the file from the
start if necessary, which would be slower but still more convenient than having to literally
restart the video and watch it all the way through just to get to an earlier unbuffered spot.</p>

<p><a href=#media-resource id=seeking:media-resource-7>Media resources</a> might be internally scripted or
interactive. Thus, a <a href=#media-element id=seeking:media-element-4>media element</a> could play in a non-linear fashion. If this
happens, the user agent must act as if the algorithm for <a href=#dom-media-seek id=seeking:dom-media-seek-2>seeking</a> was used whenever the <a href=#current-playback-position id=seeking:current-playback-position-9>current playback position</a>
changes in a discontinuous fashion (so that the relevant events fire). If the <a href=#media-element id=seeking:media-element-5>media
element</a> has a <a href=#current-media-controller id=seeking:current-media-controller>current media controller</a>, then the user agent must <a href=#seek-the-media-controller id=seeking:seek-the-media-controller>seek
the media controller</a> appropriately instead. </p>
the media controller</a> appropriately instead.</p>



Expand Down Expand Up @@ -26507,10 +26520,13 @@ red:89
<p>When a <code id=time-ranges:timeranges-2><a href=#timeranges>TimeRanges</a></code> object is said to be a <dfn id=normalised-timeranges-object>normalised <code>TimeRanges</code>
object</dfn>, the ranges it represents must obey the following criteria:</p>

<ul><li>The start of a range must be greater than the end of all earlier ranges.<li>The start of a range must be less than the end of that same range.</ul>
<ul><li>The start of a range must be greater than the end of all earlier ranges.<li>The start of a range must be less than or equal to the end of that same range.</ul>

<p>In other words, the ranges in such an object are ordered, don't overlap, aren't empty, and
don't touch (adjacent ranges are folded into one bigger range).</p>
<p>In other words, the ranges in such an object are ordered, don't overlap, and don't touch
(adjacent ranges are folded into one bigger range). A range can be empty (referencing just a
single moment in time), e.g. to indicate that only one frame is currently buffered in the case
that the user agent has discarded the entire <a href=#media-resource id=time-ranges:media-resource>media resource</a> except for the current
frame, when a <a href=#media-element id=time-ranges:media-element>media element</a> is paused.</p>

<p>Ranges in a <code id=time-ranges:timeranges-3><a href=#timeranges>TimeRanges</a></code> object must be inclusive.</p>

Expand All @@ -26519,7 +26535,7 @@ red:89
zero would have a start equal to zero and an end equal to the duration of the timeline.</p>

<p>The timelines used by the objects returned by the <code id=time-ranges:dom-media-buffered><a href=#dom-media-buffered>buffered</a></code>, <code id=time-ranges:dom-media-seekable><a href=#dom-media-seekable>seekable</a></code> and
<code id=time-ranges:dom-media-played><a href=#dom-media-played>played</a></code> IDL attributes of <a href=#media-element id=time-ranges:media-element>media
<code id=time-ranges:dom-media-played><a href=#dom-media-played>played</a></code> IDL attributes of <a href=#media-element id=time-ranges:media-element-2>media
elements</a> must be that element's <a href=#media-timeline id=time-ranges:media-timeline>media timeline</a>.</p>


Expand Down
24 changes: 20 additions & 4 deletions source
Expand Up @@ -30822,13 +30822,26 @@ interface <dfn>HTMLMediaElement</dfn> : <span>HTMLElement</span> {
sliding window on an infinite stream. This is the behavior seen with DVRs viewing live TV, for
instance.</p>

<p>User agents should adopt adopt a very liberal and optimistic view of what is seekable. User
agents should also buffer recent content where possible to enable seeking to be fast.</p>

<p class="example">For instance, consider a large video file served on an HTTP server without
support for HTTP Range requests. A browser <em>could</em> implement this by only buffering the
current frame and data obtained for subsequent frames, never allow seeking, except for seeking to
the very start by restarting the playback. However, this would be a poor implementation. A high
quality implementation would buffer the last few minutes of content (or more, if sufficient
storage space is available), allowing the user to jump back and rewatch something surprising
without any latency, and would in addition allow arbitrary seeking by reloading the file from the
start if necessary, which would be slower but still more convenient than having to literally
restart the video and watch it all the way through just to get to an earlier unbuffered spot.</p>

<p><span data-x="media resource">Media resources</span> might be internally scripted or
interactive. Thus, a <span>media element</span> could play in a non-linear fashion. If this
happens, the user agent must act as if the algorithm for <span
data-x="dom-media-seek">seeking</span> was used whenever the <span>current playback position</span>
changes in a discontinuous fashion (so that the relevant events fire). If the <span>media
element</span> has a <span>current media controller</span>, then the user agent must <span>seek
the media controller</span> appropriately instead. </p>
the media controller</span> appropriately instead.</p>

</div>

Expand Down Expand Up @@ -34296,12 +34309,15 @@ red:89

<li>The start of a range must be greater than the end of all earlier ranges.</li>

<li>The start of a range must be less than the end of that same range.</li>
<li>The start of a range must be less than or equal to the end of that same range.</li>

</ul>

<p>In other words, the ranges in such an object are ordered, don't overlap, aren't empty, and
don't touch (adjacent ranges are folded into one bigger range).</p>
<p>In other words, the ranges in such an object are ordered, don't overlap, and don't touch
(adjacent ranges are folded into one bigger range). A range can be empty (referencing just a
single moment in time), e.g. to indicate that only one frame is currently buffered in the case
that the user agent has discarded the entire <span>media resource</span> except for the current
frame, when a <span>media element</span> is paused.</p>

<p>Ranges in a <code>TimeRanges</code> object must be inclusive.</p>

Expand Down

0 comments on commit 40c18d7

Please sign in to comment.