This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2020.
The MediaElementAudioSourceNode interface's read-only mediaElement property indicates the HTMLMediaElement that contains the audio track from which the node is receiving audio.
This stream was specified when the node was first created, either using the MediaElementAudioSourceNode() constructor or the AudioContext.createMediaElementSource() method.
An HTMLMediaElement representing the element which contains the source of audio for the node.
const audioCtx = new window.AudioContext();
const audioElem = document.querySelector("audio");
let options = {
mediaElement: audioElem,
};
let source = new MediaElementAudioSourceNode(audioCtx, options);
console.log(source.mediaElement);
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
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/mediaElement