Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Documentation for javascript audio methods?

I've searched and found many articles that discuss the common methods you can use in javascript to control HTML audio elements. However, I have not been able to find anywhere that lists all of the methods available.

I should make it clear that I'm not looking for HTML audio attributes. I'm looking for methods like audio.play() and audio.pause(). I've seen these methods used in code samples all over the place, but I can't find an exhaustive list for the life of me.

like image 342
Bryan Downing Avatar asked Jan 03 '11 23:01

Bryan Downing


People also ask

How do you give audio in JavaScript?

Audio play() Method The play() method starts playing the current audio. Tip: This method is often used together with the pause() method. Tip: Use the controls property to display audio controls (like play, pause, seeking, volume, etc, attached on the audio).

What is JavaScript audio?

Audio() The Audio() constructor creates and returns a new HTMLAudioElement which can be either attached to a document for the user to interact with and/or listen to, or can be used offscreen to manage and play audio.

What is HTMLAudioElement?

The HTMLAudioElement interface provides access to the properties of <audio> elements, as well as methods to manipulate them. This element is based on, and inherits properties and methods from, the HTMLMediaElement interface.


2 Answers

You're looking for something more generic: HTMLMediaElement, here are some reference guides:

https://developer.mozilla.org/en/DOM/HTMLMediaElement

http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#audio

https://developer.apple.com/documentation/webkitjs/htmlmediaelement

like image 138
methodofaction Avatar answered Sep 28 '22 22:09

methodofaction


For Mozilla Firefox's implementation (Gecko), see the following in the Mozilla Development Center:

  • https://developer.mozilla.org/En/HTML/Element/Audio
  • https://developer.mozilla.org/en/DOM/HTMLAudioElement
  • https://developer.mozilla.org/en/Introducing_the_Audio_API_Extension

For Internet Explorer 9 (currently beta), see the following at MSDN:

  • http://msdn.microsoft.com/en-us/library/ff975061.aspx
like image 25
calvinf Avatar answered Sep 28 '22 21:09

calvinf