Execute a script when the seeking attribute is set to true indicating that seeking is active in HTML?



Use the onseeking attribute to indicate that seeking is active in a video in HTML.

Example

You can try to run the following code to execute a script when the seeking attribute is set to true indicating that seeking is active in HTML −

<!DOCTYPE html>
<html>
   <body>
      <video controls onseeking = "display()">
         <source src = "/html5/foo.ogg" type = "video/ogg" />
         <source src = "/html5/foo.mp4" type = "video/mp4" />
         Your browser does not support the video element.
      </video>
      <script>
         function display() {
            alert("Seeking starts!");
         }
      </script>
   </body>
</html>

Advertisements