Javascript examples for DOM HTML Element:Audio
The controller property returns the current media controller of the audio.
Type | Description |
---|---|
MediaController Object | Represents the media controller of the audio. |
MediaController Object properties/methods:
The following code shows how to Find out if the audio has a media controller:
<!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. ja v a 2 s. c o m <button onclick="myFunction()">check if the audio has a media controller</button> <p id="demo"></p> <script> function myFunction() { var x = document.getElementById("myAudio").controller; document.getElementById("demo").innerHTML = x; } </script> </body> </html>