Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement MediaStreamAudioDestinationNode, MediaStreamAudioSourceNode, MediaStreamTrackAudioSourceNode #27143

Merged
merged 10 commits into from Jul 3, 2020

Add MediaStream::new_single()

  • Loading branch information
Manishearth committed Jul 2, 2020
commit bf9614edf77c4e7aa0a74a5a98923b3d2f77821b
@@ -13,6 +13,7 @@ use crate::dom::globalscope::GlobalScope;
use crate::dom::mediastreamtrack::MediaStreamTrack;
use crate::dom::window::Window;
use dom_struct::dom_struct;
use servo_media::streams::registry::MediaStreamId;
use servo_media::streams::MediaStreamType;

#[dom_struct]
@@ -34,6 +35,17 @@ impl MediaStream {
reflect_dom_object(Box::new(MediaStream::new_inherited()), global)
}

pub fn new_single(
global: &GlobalScope,
id: MediaStreamId,
ty: MediaStreamType,
) -> DomRoot<MediaStream> {
let this = Self::new(global);
let track = MediaStreamTrack::new(global, id, ty);
this.AddTrack(&track);
this
}

pub fn Constructor(global: &Window) -> Fallible<DomRoot<MediaStream>> {
Ok(MediaStream::new(&global.global()))
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.