Web Audio API
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.MediaElementAudioSourceNode constructor or the AudioContext.createMediaElementSource() method.
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
Browser compatibility
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
