Execute a JavaScript when a video is ready to start after having been paused: - Javascript DOM Event

Javascript examples for DOM Event:onplaying

Description

Execute a JavaScript when a video is ready to start after having been paused:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<video controls onplaying="myFunction()">
  <source src="your.mp4" type="video/mp4">
  <source src="your.ogg" type="video/ogg">
  Your browser does not support the video tag.
</video>/*w ww. ja  v  a2s .  com*/

<script>
function myFunction() {
    console.log("The video is now playing");
}
</script>

</body>
</html>

Related Tutorials