oncanplaythrough 사용 HTML에서 버퍼링을 위해 일시 중지하지 않고 파일을 끝까지 재생할 수 있을 때 스크립트를 실행하는 속성입니다.
예시
다음 코드를 실행하여 oncanplaythrough를 구현할 수 있습니다. 속성 -
<!DOCTYPE html>
<html>
<body>
<video id = "myVideo" width = "400" height = "200" controls oncanplaythrough = "display()">
<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() {
alert("Can be played without pausing for buffering.");
}
</script>
</body>
</html>