Audio currentTimeProperty

Audio 对象参考手册Audio Object

Example

Set the time position to 1 second:

document.getElementById("myAudio").currentTime = 1;

Try it Yourself »

Definition and Usage

The currentTime property sets or returns the current playback position of the audio (in seconds).

When setting this property, the playback will jump to the specified position.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the currentTime property.

Note:Internet Explorer 8 or earlier browsers do not support this property.


Syntax

Return the currentTime property:

audioObject.currentTime

Set the currentTime property:

audioObject.currentTime=seconds

Property Values

Value Description
seconds Indicates the current playback position of the audio (in seconds).

Technical Details

Return value: A number representing the current playback time (in seconds).


Audio 对象参考手册Audio Object Other Extensions