Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk4 min

How to Fix or Hide Infinity:NaN:NaN in a JavaScript Video Player

Infinity:NaN:NaN can appear when a video time display receives non-finite media values. Check the live-stream-to-recording transition and guard custom formatters without mistaking a hidden display for a media fix.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If a video player shows Infinity:NaN:NaN, first check the media element’s duration and currentTime. The values may be non-finite because no media data is ready yet or the media’s end time is unknown. You can guard a custom time display against those values, but hiding the text does not fix missing duration information or establish why Firefox is reporting it.

What Infinity:NaN:NaN means

The string is usually a time formatter displaying values it cannot turn into a normal timestamp. In the HTML media API, HTMLMediaElement.duration is measured in seconds. It is NaN when no media data is available and positive Infinity when the media resource is not known to have a bounded duration, such as a live stream without an announced end. The HTML Standard defines these values; MDN documents the property.

duration is read-only, so assigning a replacement value to it is not the way to remove the display. If an unbounded stream ends, the standard says its duration can change to the time of its final frame or sample, and the browser fires durationchange.

Check whether the browser or your page draws the text

The 2017 SitePoint post described the value appearing in Firefox video controls after a recording, but did not establish whether the display came from native browser controls or custom page code. It also did not include a usable recording, Firefox version, or operating system. See the original SitePoint discussion.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
Where the text appears What to check
Custom time display made by your page Inspect the formatter and the values it receives. Guard against non-finite values before formatting.
Browser-native controls Inspect the media element’s values and source transition. Page code can avoid feeding bad values to its own formatter, but cannot directly rewrite the native control’s display.

Inspect the live-stream-to-recording transition

In the SitePoint example, the page first assigns a live camera and microphone stream to video.srcObject, then creates a MediaRecorder. When recording data arrives, the script clears srcObject, assigns a Blob URL to video.src, creates a video/webm Blob for upload, and adds the controls attribute when the stop button is clicked. These are distinct media phases: a live stream may have no known end, while the recorded Blob is expected to be finite.

Log the element’s values during the transition, including after metadata loads and when duration changes:

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
const video = document.querySelector("video");

function logMediaState(label) {
  console.log(label, {
    duration: video.duration,
    currentTime: video.currentTime,
    readyState: video.readyState,
    error: video.error
  });
}

video.addEventListener("loadedmetadata", () => logMediaState("loadedmetadata"));
video.addEventListener("durationchange", () => logMediaState("durationchange"));
video.addEventListener("ended", () => logMediaState("ended"));

logMediaState("initial");

Also log immediately before and after replacing srcObject with the Blob URL. This shows whether the non-finite values belong to the live stream, the new recording, or a point before metadata is available.

Prevent a custom formatter from displaying invalid times

When the page owns the time display, only format values that are finite. For an unknown duration, show a deliberate label such as “Live” or “Duration unavailable” instead of passing the value into a timestamp formatter.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.
function formatTime(seconds) {
  if (!Number.isFinite(seconds) || seconds < 0) {
    return "Duration unavailable";
  }

  const wholeSeconds = Math.floor(seconds);
  const minutes = Math.floor(wholeSeconds / 60);
  const remainder = wholeSeconds % 60;
  return `${String(minutes).padStart(2, "0")}:${String(remainder).padStart(2, "0")}`;
}

function updateTimeDisplay(video, element) {
  element.textContent = Number.isFinite(video.currentTime)
    ? formatTime(video.currentTime)
    : "Time unavailable";
}

Choose the fallback text to match your interface: a live player can say “Live,” while a recording that has not loaded metadata can say “Loading.” The example prevents a custom formatter from turning non-finite input into a malformed time; it does not repair the media or change native controls.

If the recorded WebM still reports Infinity

Test the exact recorded Blob as a standalone source after metadata has loaded. Record its MIME type, Firefox build, and the resulting duration and currentTime values; compare the same file in another current browser if available. If Firefox continues to report Infinity for a finite recording, duration or index metadata in the WebM is one area to investigate.

Rank #4
Sale
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient

Mozilla documented historical cases of MediaRecorder-created WebM files reporting Infinity. Bug 1385699 was marked fixed for Firefox 57, while Bug 1601061 reported the behavior in Firefox 69, 70, and 71 and remains unconfirmed in its record. These reports show that related behavior has occurred; they do not identify the cause of the SitePoint poster’s symptom or establish current Firefox behavior.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What the original thread establishes

The SitePoint discussion dates to November 16, 2017. Its author reported that Firefox alone showed Infinity:NaN:NaN in place of an elapsed-time value, but supplied no reproducible recording or exact browser and operating-system versions. The reply did not confirm a cause or a working fix. It linked to a separate 2016 Firefox 44.0.2 report involving a YouTube add-on and a NaN:NaN control display; that different setup is not proof of the cause here. The available evidence therefore supports checking the media values and source transition, not attributing the symptom to one confirmed Firefox bug.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.