Audio seeking Property - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Audio

Description

The seeking property returns if the user is currently seeking in the audio, which is the time that you move to a new position in the audio.

This property is read-only.

Return Value

A Boolean, returns true if the user is currently seeking, otherwise it returns false

The following code shows how to Show if the user is currently seeking in the audio:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<audio id="myAudio" controls onseeking="myFunction()" onseeked="myFunction()">
  <source src="your.ogg" type="audio/ogg">
  <source src="your.mp3" type="audio/mpeg">
  Your browser does not support the audio element.
</audio>// w  ww  . ja  va2 s  .  c  om

<span id="mySpan"></span>

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

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

</body>
</html>

Related Tutorials