Javascript DOM HTML Video loop Property get

Introduction

Find out if the video should start playing over again every time it is finished:

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

Click the button to find out if the video should start playing over again every time it is finished.

View in separate window

<!DOCTYPE html>
<html>
<body>

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

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

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

</body>
</html>



PreviousNext

Related