MediaElementAudioSourceNode: mediaElement property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since April 2021.

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.

Value

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

Examples

js
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
Web Audio API
# dom-mediaelementaudiosourcenode-mediaelement

Browser compatibility

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
mediaElement

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support