- From: Eirik Jo Björnerstedt via GitHub <noreply@w3.org>
- Date: Fri, 24 Oct 2025 16:10:29 +0000
- To: public-html-media@w3.org
eirikbjornr has just created a new issue for https://github.com/w3c/media-source: == Model `seekable` range for a MediaSource with finite duration == To my understanding the aim of the HTMLMediaElement `seekable` property is to model the seekability of the current source. > The `seekable` attribute must return a new static [normalized `TimeRanges` object](https://html.spec.whatwg.org/multipage/media.html#normalised-timeranges-object) that represents the ranges of the [media resource](https://html.spec.whatwg.org/multipage/media.html#media-resource), if any, that the user agent is able to seek to, at the time the attribute is evaluated. In the context of MSE, `seekable` returns a time range from time zero to the `MediaSource`'s duration _if the duration is finite_. Otherwise, if duration is Infinity, `seekable` returns the internal [live seekable range property](https://w3c.github.io/media-source/#dfn-live-seekable-range). (link: https://w3c.github.io/media-source/#htmlmediaelement-extensions-seekable) There are cases where a finite duration does not mean time 0 is seekable. Sometimes a livestream is up for so long the start of the stream is no longer available when the stream ends. For example, our event streams (concerts etc.) sometimes overrun the 25H capacity we keep on or CDNs. To seek into that range would trigger a player error. Despite this, the `seekable` property always starts at 0 if the duration of the stream is finite (Section 10.1, step 3). Calling `endOfStream()` will result in a finite duration (see [step 3 of the end of stream algorithm](https://w3c.github.io/media-source/#end-of-stream-algorithm)). Hence, it is not possible to model the availability of the livestream using the `seekable` property once the stream has ended. This leaves JS media player implementers with two choices: 1. Ignore `HTMLMediaElement`'s `seekable` property and implement their own seekability model. 2. Ignore `HTMLMediaElement`'s `ended` property and implement their own "ended" model. All JS media players I've surveyed chose option 1 and implement their own seekability model (e.g., [in dash.js](https://dashif.org/dash.js/pages/usage/timing-apis.html#live)). Please view or discuss this issue at https://github.com/w3c/media-source/issues/369 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Friday, 24 October 2025 16:10:30 UTC