Javascript DOM onprogress Event

Introduction

Execute a JavaScript when the video is downloading:

View in separate window

<!DOCTYPE html>
<html>
<body>

<video controls onprogress="myFunction()">
  <source src="video.mp4" type="video/mp4">
  <source src="video.ogg" type="video/ogg">
  Your browser does not support HTML5 video.
</video>/*from  w  w w .  j  a v  a 2  s .  c o m*/

<p id="demo"></p>
<script>
function myFunction() {
  document.getElementById("demo").innerHTML = "Downloading video";
}
</script>

</body>
</html>

The onprogress event occurs when the browser is downloading the specified audio/video.

Bubbles: No
Cancelable: No
Event type: Event
Supported HTML tags: <audio>, <video>



PreviousNext

Related