HTML DOM Video seeking Property

HTMLWeb DevelopmentFront End Technology

The HTML DOM Video seeking property returns a boolean (true/false) corresponding to whether the user is seeking (moving current playback to new position) the playing video or not.

Syntax

Following is the syntax −

Returning boolean value

mediaObject.seeking

Let us see an example of HTML DOM Video seeking property −

Example

<!DOCTYPE html>
<html>
<head>
<title>HTML DOM Video seeking</title>
<style>
   * {
      padding: 2px;
      margin:5px;
   }
   form {
      width:70%;
      margin: 0 auto;
      text-align: center;
   }
   input[type="button"] {
      border-radius: 10px;
   }
</style>
</head>
<body>
   <form>
      <fieldset>
         <legend>HTML-DOM-Video-seeking</legend>
         <video id="demo" width="320" onseeking="getTrackDetails()" onseeked="getTrackDetails()"
         controls><source src="http://www.tutorialspoint.com/html5/foo.mp4"
         type="video/mp4"></video><br>
         <div id="divDisplay"></div>
      </fieldset>
   </form>
   <script>
      var divDisplay = document.getElementById("divDisplay");
      var demo = document.getElementById("demo");
      demo.autoplay =true;
      function getTrackDetails() {
         if(demo.seeking)
            divDisplay.textContent = 'To understand the concept watch full video';
      }
   </script>
</body>
</html>

Output

Before and after seeking of video −

During seeking of video −

raja
Published on 31-Oct-2019 10:45:35
Advertisements