Javascript DOM HTML Video seeking Property get

Introduction

Show if the user is currently seeking in the video:

View in separate window

<!DOCTYPE html>
<html>
<body>

<video id="myVideo" 
       width="100" 
       height="100" 
       controls onseeking="myFunction()" 
       onseeked="myFunction()">
  <source src="video.mp4" type="video/mp4">
  <source src="video.ogg" type="video/ogg">
  Your browser does not support the video tag.
</video>//from   w w w  .j  av  a 2 s. co  m

<p>Try seeking in the video: <span id="mySpan"></span></p>

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

<script>
function myFunction() {
  var x = document.getElementById("myVideo");
  document.getElementById("mySpan").innerHTML = "Seeking: " + x.seeking;
}
</script>

</body>
</html>

The seeking property returns if the user is currently seeking in the video.

Seeking is when you move to a new position in the video.

This property is read-only.

The seeking property returns true if the user is currently seeking, otherwise it returns false.




PreviousNext

Related