One timeline, two different questions
Consider a hypothetical hour-long programme. At a particular observation, buffered media might cover seconds zero to thirty, while the available seekable range covers zero to 3600. The player can be able to request a later position without already holding the whole hour locally.
These ranges should not be merged into a single download percentage. A player may fetch another section after a seek, leaving more than one buffered interval. The final endpoint alone cannot tell you how much continuous material is ready immediately ahead of the current playback position.
Calculate the relevant headroom
Suppose playback is at second twenty and the containing buffered interval ends at second thirty. The local forward headroom in that interval is ten seconds. A separate interval from second one hundred to one hundred and twenty does not add twenty seconds of continuous headroom to the current position.
A useful technical display identifies the interval containing the current position, checks that the position belongs to it, then calculates the difference. Empty ranges require an empty-state result. Trying to read the end of an interval that does not exist can create an application error before the media issue is understood.
Take observations at comparable moments
MDN describes these properties as new static range objects when accessed. A previously stored object is a snapshot, so fetch another observation when the timeline changes. Record current position and ranges together rather than combining values captured several minutes apart.
For a live presentation, the available window may also move. A range observed earlier does not promise that its beginning remains accessible later. These browser properties describe current media state, not subscription recording rights, permanent downloads or a guarantee that every seek will complete smoothly on the present connection.
Questions about this guide
Does seekable mean downloaded?
No. Seekable positions can require additional requests.
Can buffered data have gaps?
Yes. Read each interval and calculate headroom within the interval containing the current playback position.
