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

Javascript examples for DOM Event:onprogress

Description

Execute a JavaScript when the video is downloading:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<video controls onprogress="myFunction()">
  <source src="your.mp4" type="video/mp4">
  <source src="your.ogg" type="video/ogg">
  Your browser does not support HTML5 video.
</video>//www  .  j  a  v  a2  s .co m

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

</body>
</html>

Related Tutorials