지속 기간 변경 속성은 HTML에서 오디오/비디오의 길이가 변경될 때 트리거됩니다.
예시
다음 코드를 실행하여 ondurationchange를 구현할 수 있습니다. 속성 -
<!DOCTYPE HTML>
<html>
<body>
<video width = "300" height = "200" controls ondurationchange = "display(this)">
<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 display(vLength) {
alert("Video Length: " + vLength.duration + " seconds");
}
</script>
</body>
</html>