[media-source] Seeking in the buffered range should always succeed.

jyavenard has just created a new issue for 
https://github.com/w3c/media-source:

== Seeking in the buffered range should always succeed. ==
From: 
https://w3c.github.io/media-source/index.html#mediasource-seeking
describe the steps on how to seek with MSE
"If one or more of the objects in activeSourceBuffers is missing media
 segments for the new playback position
  If the HTMLMediaElement.readyState attribute is greater than 
HAVE_METADATA, then set the HTMLMediaElement.readyState attribute to 
HAVE_METADATA.
"

One can implicitly assume that seeking in the reported buffered range 
will always succeed.
in particular as we have "The web application can use buffered to 
determine what the media element needs to resume playback."

When the mediasource readyState is "open", the buffered range only 
reports where we actually have data.
However, if the readyState is "ended" 
(https://w3c.github.io/media-source/index.html#widl-SourceBuffer-buffered)
 "If readyState is "ended", then set the end time on the last range in
 track ranges to highest end time."

So let's assume that we have a media element that is made of an audio 
and video tracks.
The audio track has a buffered range of [5-10] and the video track has
 [5-20].
When in "ended" readyState, the buffered attribute reported will as 
such be [5-20]" ; however we do not have audio data in the [10-20] 
range; so according to the seeking definition, the media element 
readyState should become HAVE_METADATA and seek can't succeed.

As such two possibilities:
1- Have buffered always return the buffered range intersection of all 
tracks, regardless of the readyState value
2- Specify in the seeking steps, that if the reported buffered range 
contains the position, seeking must complete (so the UA when 
completing the seek would then play whatever left data it has without 
stalling to the end of the buffered range)

I favour option 2.

Please view or discuss this issue at 
https://github.com/w3c/media-source/issues/147 using your GitHub 
account

Received on Thursday, 11 August 2016 23:11:56 UTC