Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
The HTMLMediaElement interface's currentTime property specifies the current playback time in seconds.
Changing the value of currentTime seeks the media to the new time.
A double-precision floating-point value indicating the current playback time in seconds.
If the media is not yet playing, the value of currentTime indicates the time position within the media at which playback will begin once the play() method is called.
Setting currentTime to a new value seeks the media to the given time, if the media is available.
For media without a known duration—such as media being streamed live—it's possible that the browser may not be able to obtain parts of the media that have expired from the media buffer. Also, media whose timeline doesn't begin at 0 seconds cannot be seeked to a time before its timeline's earliest time.
The length of the media in seconds can be determined using the duration property.
To offer protection against timing attacks and fingerprinting, the precision of video.currentTime might get rounded depending on browser settings. In Firefox, the privacy.reduceTimerPrecision preference is enabled by default and defaults to 2ms. You can also enable privacy.resistFingerprinting, in which case the precision will be 100ms or the value of privacy.resistFingerprinting.reduceTimerPrecision.microseconds, whichever is larger.
For example, with reduced time precision, the result of video.currentTime will always be a multiple of 0.002, or a multiple of 0.1 (or privacy.resistFingerprinting.reduceTimerPrecision.microseconds) with privacy.resistFingerprinting enabled.
| HTML # dom-media-currenttime-dev |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Jul 4, 2024 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.