duration
Collapse the table of content
Expand the table of content

duration property

Returns the duration in seconds of the current media resource. A NaN value is returned if duration is not available, or Infinity if the media resource is streaming.

HTML5 A vocabulary and associated APIs for HTML and XHTML, Section 4.8.9.6Internet Explorer 9

 

Syntax

object.get_duration(number* seconds);

Property values

Type: number

A floating point number that represents 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

See also

How to use HTML5 to play video files on your webpage
How to use HTML5 to Add an Audio Player to your Webpage

 

 

Show:
© 2016 Microsoft