<html>
<body>
<h1>HTML DOM Events</h1>
<h2>The oncanplaythrough</h2>
<audio controls oncanplaythrough="myFunction()">
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
<p id="demo"></p>
<script>
function myFunction() {
document.getElementById("demo").innerHTML = "Can play through without stopping.";
}
</script>
</body>
</html>