Audio paused Property - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Audio

Description

The paused property returns whether the audio is paused.

This property is read-only.

Return Value

A Boolean, returns true if the audio is paused. Otherwise it returns false

The following code shows how to check if the audio is paused:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<audio id="myAudio" controls>
  <source src="your.ogg" type="audio/ogg">
  <source src="your.mp3" type="audio/mpeg">
  Your browser does not support the audio element.
</audio>/*from w w w .j a v  a2 s . co  m*/

<p>Click the button to find out if the audio is paused.</p>

<button onclick="myFunction()">Test</button>

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

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

</body>
</html>

Related Tutorials