MediaElementAudioSourceNode: thuộc tính mediaElement
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.
Thuộc tính chỉ đọc mediaElement của giao diện MediaElementAudioSourceNode cho biết HTMLMediaElement chứa track âm thanh mà nút đang nhận âm thanh từ đó.
Luồng này được chỉ định khi nút được tạo lần đầu, sử dụng hàm khởi tạo MediaElementAudioSourceNode() hoặc phương thức AudioContext.createMediaElementSource().
Giá trị
Một HTMLMediaElement đại diện cho phần tử chứa nguồn âm thanh cho nút.
Ví dụ
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);
Thông số kỹ thuật
| Specification |
|---|
| Web Audio API> # dom-mediaelementaudiosourcenode-mediaelement> |