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.


audioSourceElement = mediaElementAudioSourceNode.mediaElement;


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);


Specification Status Comment
Web Audio API
The definition of 'MediaElementAudioSourceNode.mediaElement' in that specification.
Working Draft

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
mediaElementChrome Full support YesEdge Full support ≤79Firefox Full support 70IE No support NoOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android No support NoOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes


Full support  
Full support
No support  
No support