W3cubDocs

/Web APIs

MediaElementAudioSourceNode

The MediaElementAudioSourceNode interface represents an audio source consisting of an HTML <audio> or <video> element. It is an AudioNode that acts as an audio source.

A MediaElementAudioSourceNode has no inputs and exactly one output, and is created using the AudioContext.createMediaElementSource() method. The number of channels in the output equals the number of channels of the audio referenced by the HTMLMediaElement used in the creation of the node, or is 1 if the HTMLMediaElement has no audio.

EventTarget AudioNode MediaElementAudioSourceNode
Number of inputs 0
Number of outputs 1
Channel count 2 (but note that AudioNode.channelCount is only used for up-mixing and down-mixing AudioNode inputs, and MediaElementAudioSourceNode doesn't have any input)

Constructor

MediaElementAudioSourceNode()

Creates a new MediaElementAudioSourceNode object instance.

Instance properties

Inherits properties from its parent, AudioNode.

mediaElement Read only

The HTMLMediaElement used when constructing this MediaStreamAudioSourceNode.

Instance methods

Inherits methods from its parent, AudioNode.

Example

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
MediaElementAudioSourceNode 55 79 53 No 42 14.1 55 55 53 42 14.5 6.0
MediaElementAudioSourceNode 15 12 25 No 15 6 4.4.3 18 25 14 6 1.0
mediaElement 15 79 70 No 15 6 ≤37 18 79 14 6 1.0

See also

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/MediaElementAudioSourceNode