UK IPTV · 1 MONTH £7.49 GBP TOTALInstall your player. Request a one-day trial ↗

Viewing journal

A browser progress bar needs to handle unknown and unbounded duration

HTML media duration can be NaN before data is available or Infinity for media without a known end. Treat those states explicitly instead of calculating a misleading percentage.

Catch-up needs availability
Catch-up needs availability

Media diagnostics · Primary-source explanation; examples are illustrative. Instructions are based on publisher guidance; a UK IPTV account was not tested on this platform.

Inspect the value before dividing

MDN documents HTML media duration as seconds when a usable finite duration exists, NaN when media data is unavailable, and Infinity when the media has no known duration such as a live stream. A progress percentage which blindly divides currentTime by duration can therefore produce an unusable result. The player interface should distinguish unknown loading state, finite programme progress and a live or otherwise unbounded timeline rather than displaying a fabricated zero percent.

Use a finite worked example only where it fits

For an original calculation, a finite clip at 90 seconds within a 180 second duration is halfway through its timeline. That arithmetic does not transfer to an infinite duration by substituting a very large guessed end time. It also does not mean half of the clip bytes have been downloaded. Keep programme progress, seekable range and network transfer measurements as different observations so the controls answer the intended question.

Update the interface when information changes

Wait for relevant media information and respond when the duration changes, while keeping a clear state for unavailable values. Do not use a programme guide slot length as an invented browser media duration unless the application deliberately explains that different reference. This article covers numerical handling in a progress control. It does not establish a complete recording, the length of a live event, successful seek support or a measured UK IPTV playback implementation.

Sources and further reading

Continue reading

Make the first step a useful one

Your screen.
Your next good evening.

Tell us the device and player you use. Compare the term, ask your questions and prepare for a one-day trial.

↑