mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Implement AudioContext.createMediaElementAudioSourceNode()
This commit is contained in:
parent
a72e46f9c8
commit
04f4da3e13
3 changed files with 20 additions and 7 deletions
|
@ -20,6 +20,8 @@ use crate::dom::bindings::num::Finite;
|
|||
use crate::dom::bindings::refcounted::{Trusted, TrustedPromise};
|
||||
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject};
|
||||
use crate::dom::bindings::root::DomRoot;
|
||||
use crate::dom::htmlmediaelement::HTMLMediaElement;
|
||||
use crate::dom::mediaelementaudiosourcenode::MediaElementAudioSourceNode;
|
||||
use crate::dom::promise::Promise;
|
||||
use crate::dom::window::Window;
|
||||
use crate::task_source::TaskSource;
|
||||
|
@ -244,6 +246,16 @@ impl AudioContextMethods for AudioContext {
|
|||
// Step 6.
|
||||
promise
|
||||
}
|
||||
|
||||
/// https://webaudio.github.io/web-audio-api/#dom-audiocontext-createmediaelementsource
|
||||
fn CreateMediaElementSource(
|
||||
&self,
|
||||
media_element: &HTMLMediaElement,
|
||||
) -> Fallible<DomRoot<MediaElementAudioSourceNode>> {
|
||||
let global = self.global();
|
||||
let window = global.as_window();
|
||||
MediaElementAudioSourceNode::new(window, self, media_element)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<AudioContextLatencyCategory> for LatencyCategory {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue