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 July 2020.
TheMediaElementAudioSourceNode interface'sread-onlymediaElement property indicates theHTMLMediaElement that contains the audio track from which the node isreceiving audio.
This stream was specified when the node was first created,either using theMediaElementAudioSourceNode()constructor or theAudioContext.createMediaElementSource() method.
In this article
Value
AnHTMLMediaElement representing the element which contains the sourceof 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> |