Latest web development tutorials

HTML DOM Audio currentTime property

Audio Object Reference Audio Object

Examples

The time position is set to 1 second:

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

try it"

Definition and Usage

urrentTime property sets or returns the current position of the audio playback (in seconds)

When this property is set, the player will jump to the specified location.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support currentTime property.

Note: Internet Explorer 8 or earlier browser does not support this property.


grammar

Back currentTime properties:

audioObject .currentTime

Setting currentTime properties:

audioObject .currentTime=seconds

Property Value

描述
seconds 指示音频播放的当前位置(以秒计)。

technical details

return value: A number that indicates the current playback time (in seconds).


Audio Object Reference Audio Object