ontimeupdate 속성 이벤트는 비디오와 같은 미디어의 재생 위치가 변경될 때 트리거됩니다. 비디오나 오디오에서 빨리 감기 또는 뒤로 갈 수 있습니다.
예시
다음 코드 구현을 실행해 볼 수 있습니다. ontimeupdate 속성 -
<!DOCTYPE html>
<html>
<body>
<h2 id="test">Play</h2>
<video id = "myid" width="320" height = "176" controls ontimeupdate = "myFunction()">
<source src = "/html5/foo.ogg" type = "video/ogg" />
<source src = "/html5/foo.mp4" type = "video/mp4" />
Your browser does not support the video element.
</video>
<script>
function myFunction() {
document.getElementById("test").innerHTML = "Current position: " +
document.getElementById("myid").currentTime;
}
</script>
</body>
</html>