mirror of
https://github.com/servo/servo.git
synced 2025-07-23 23:33:43 +01:00
Add RTCPeerConnection::AddStream
This commit is contained in:
parent
8b0719a6f2
commit
2d8ac7825c
3 changed files with 25 additions and 2 deletions
|
@ -22,6 +22,7 @@ use crate::dom::bindings::root::{DomRoot, MutNullableDom};
|
|||
use crate::dom::event::{Event, EventBubbles, EventCancelable};
|
||||
use crate::dom::eventtarget::EventTarget;
|
||||
use crate::dom::globalscope::GlobalScope;
|
||||
use crate::dom::mediastream::MediaStream;
|
||||
use crate::dom::promise::Promise;
|
||||
use crate::dom::rtcicecandidate::RTCIceCandidate;
|
||||
use crate::dom::rtcpeerconnectioniceevent::RTCPeerConnectionIceEvent;
|
||||
|
@ -390,6 +391,15 @@ impl RTCPeerConnectionMethods for RTCPeerConnection {
|
|||
}).into());
|
||||
p
|
||||
}
|
||||
|
||||
// https://w3c.github.io/webrtc-pc/#legacy-interface-extensions
|
||||
fn AddStream(&self, stream: &MediaStream) {
|
||||
let mut tracks = stream.get_tracks();
|
||||
|
||||
for track in tracks.drain(..) {
|
||||
self.controller.borrow().as_ref().unwrap().add_stream(track);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<SessionDescription> for RTCSessionDescriptionInit {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue