Javascript DOM HTML Video paused Property get

Introduction

Find out if the video is paused:

var x = document.getElementById("myVideo").paused;

Click the button to find out if the video is paused.

View in separate window

<!DOCTYPE html>
<html>
<body>

<video id="myVideo" width="100" height="100" controls>
  <source src="video.mp4" type="video/mp4">
  <source src="video.ogg" type="video/ogg">
  Your browser does not support the video tag.
</video>//  w w w  .j a  v  a2 s .  c om
<button onclick="myFunction()">Test</button>

<p id="demo"></p>

<script>
function myFunction() {
  var x = document.getElementById("myVideo").paused;
  document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

The paused property returns whether the video is paused.

The paused property returns true if the video is paused. Otherwise it returns false.




PreviousNext

Related