This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
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.
| 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) |
MediaElementAudioSourceNode()Creates a new MediaElementAudioSourceNode object instance.
Inherits properties from its parent, AudioNode.
mediaElement Read only
The HTMLMediaElement used when constructing this MediaStreamAudioSourceNode.
Inherits methods from its parent, AudioNode.
See AudioContext.createMediaElementSource() for example code.
| Specification |
|---|
| Web Audio API> # MediaElementAudioSourceNode> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
MediaElementAudioSourceNode |
55 | 79 | 53 | 42 | 14.1 | 55 | 53 | 42 | 14.5 | 6.0 | 55 | 14.5 |
MediaElementAudioSourceNode |
15 | 12 | 25 | 15 | 6 | 18 | 25 | 14 | 6 | 1.0 | 4.4 | 6 |
mediaElement |
15 | 79 | 70 | 15 | 6 | 18 | 79 | 14 | 6 | 1.0 | 4.4 | 6 |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/MediaElementAudioSourceNode