W3cubDocs

/Web APIs

MediaElementAudioSourceNode: mediaElement property

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

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
mediaElement 15 79 70 No 15 6 ≤37 18 79 14 6 1.0

© 2005–2023 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