Web/API/MediaElementAudioSourceNode/mediaElement

From Get docs


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.

Syntax

audioSourceElement = mediaElementAudioSourceNode.mediaElement;

Value

An HTMLMediaElement representing the element which contains the source of audio for the node.

Examples

const audioCtx = new window.AudioContext();
const audioElem = document.querySelector('audio');

let options = {
  mediaElement: audioElem
}

let source = new MediaElementAudioSourceNode(audioCtx, options);
console.log(source.mediaElement);

Specifications

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

Browser compatibility

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
mediaElement Chrome

Full support Yes

Edge

Full support ≤79

Firefox

Full support 70

IE

No support No

Opera

Full support Yes

Safari

Full support Yes

WebView Android

Full support Yes

Chrome Android

Full support Yes

Firefox Android

No support No

Opera Android

Full support Yes

Safari iOS

Full support Yes

Samsung Internet Android

Full support Yes

Legend

Full support  
Full support
No support  
No support