Advertisement
Home Open Editor ❯

HTML Audio/Video DOM currentTime Property

Example

var vid = document.getElementById("myVideo");

function getCurTime() {
  alert(vid.currentTime);
}

function setCurTime() {
  vid.currentTime=10;
}

function reStart() {
  vid.currentTime=0;
}

Try this code ❯

Meaning

The currentTime property sets or returns the current playback position in the audio/video.


Standard Syntax

audio|video.currentTime="seconds"


Advertisement

Return Value

Type Description
seconds Specifies the position for the playback of the audio/video, in seconds.
Home Open Editor ❯
Advertisement