Execute a JavaScript when the audio is downloading: - Javascript DOM Event

Javascript examples for DOM Event:onprogress

Description

Execute a JavaScript when the audio is downloading:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<audio controls onprogress="myFunction()">
  <source src="your.ogg" type="audio/ogg">
  <source src="your.mp3" type="audio/mpeg">
  Your browser does not support the audio element.
</audio>/*  w  w w .j  av  a2  s  . c  om*/

<script>
function myFunction() {
    console.log("Downloading video");
}
</script>

</body>
</html>

Related Tutorials