w3c / media-source

Media Source Extensions
https://w3c.github.io/media-source/
Other
267 stars 59 forks source link

Live stream with live seekable range and removal of buffered media around currentTime can cause currentTime to be outside of HTMLME.seekable #291

Open wolenetz opened 2 years ago

wolenetz commented 2 years ago

Perhaps surprising to API users, there is a scenario where currentTime can become outside of the seekable range simply due to a change in what is buffered, when the duration is +Infinity and |live seekable range| is not empty.

Example:

Then, let's suppose a seek to and playback of media buffered at time [3,6) is done. currentTime begins to progress. Then, let's suppose app removes [3,6). currentTime remains somewhere in that range, since it previously could not have progressed across the buffered range gap to the next buffered range that begins at time 20.

So, currentTime is somewhere in 3..6. But HTMLMediaElement.seekable is now { [10, 50) }.

I think this scenario merits at least a non-normative note in the MSE-extended seekable steps.

Also, is this a normative issue with the spec? (Should .seekable also depend on currentTime in this scenario??)

wolenetz commented 2 years ago

Credit to jazzhsu@chromium.org for noting this potentially surprising scenario when updating Chromium's default media controls (https://chromium-review.googlesource.com/c/chromium/src/+/3042502)