Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML Audio/Video DOM currentTime Property

HTML Audio/Video DOM currentTime Property

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

Example

Set the time position to 5 seconds:

myVid=document.getElementById("video1");

myVid.currentTime=5;

Try it »


Definition and Usage

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

When this attribute is set, playback jumps to the specified position.


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the currentTime attribute.

**Note:** Internet Explorer 8 and earlier versions do not support this property.


Syntax

Set the currentTime attribute:

audio|video

.currentTime="

seconds

"

Return the currentTime attribute:

audio|video

.currentTime

Attribute values

Value Description
seconds Indicates the current playback position of the audio/video, in seconds.

Technical Details

Return Value: A numeric value representing seconds

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