Latest web development tutorials

HTML Audio / Video DOM currentTime property

HTML audio / video Tag Reference HTML Audio / Video DOM Reference

Examples

The time position is set to 5 seconds:

myVid=document.getElementById("video1");
myVid.currentTime=5;

try it"

Definition and Usage

currentTime property sets or returns the current position of the audio / video 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: 8 and earlier versions of Internet Explorer does not support this property.


grammar

Setting currentTime properties:

audio|video .currentTime="seconds"

Back currentTime properties:

audio|video .currentTime

Property Value

描述
seconds 指示音频/视频播放的当前位置,以秒计。

technical details

返回值: 数字值,表示秒


HTML audio / video Tag Reference HTML Audio / Video DOM Reference