duration property
Gets the duration, in seconds, of the current media resource, a NaN value if duration is not available, or Infinity if the media resource is streaming.
![]() ![]() |
Syntax
| JavaScript | |
|---|
Property values
Type: Floating-point
The duration of the current media resource, in seconds.
time in seconds
-
The duration of the current media, in seconds.
NaN (Not a Number)
-
The duration is not available.
Infinity
-
The media is streaming.
Standards information
- HTML5 A vocabulary and associated APIs for HTML and XHTML, Section 4.8.9.6
See also
- media
- audio
- audio
- video element
- video object
- How to use HTML5 to play video files on your webpage
- How to use HTML5 to Add an Audio Player to your Webpage
Send comments about this topic to Microsoft
Build date: 11/27/2012

