From e4aa371fe5fa96a80b2bb30f979fa68b11c10163 Mon Sep 17 00:00:00 2001 From: Andreas Pehrson Date: Fri, 25 Sep 2015 23:23:30 +0800 Subject: [PATCH] Bug 1103188 - MediaStream WebIDL update with addTrack/removeTrack. r=smaug,jib --HG-- extra : commitid : FxucwRqUZUo --- dom/media/DOMMediaStream.h | 2 ++ dom/webidl/MediaStream.webidl | 30 ++++++++++++++++++------------ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/dom/media/DOMMediaStream.h b/dom/media/DOMMediaStream.h index 3d804e54ec60..ec98a9e7e3e5 100644 --- a/dom/media/DOMMediaStream.h +++ b/dom/media/DOMMediaStream.h @@ -210,6 +210,8 @@ public: void GetAudioTracks(nsTArray >& aTracks); void GetVideoTracks(nsTArray >& aTracks); void GetTracks(nsTArray >& aTracks); + void AddTrack(MediaStreamTrack& aTrack); + void RemoveTrack(MediaStreamTrack& aTrack); // NON-WebIDL diff --git a/dom/webidl/MediaStream.webidl b/dom/webidl/MediaStream.webidl index 50ac83b989da..a795ad0f54f3 100644 --- a/dom/webidl/MediaStream.webidl +++ b/dom/webidl/MediaStream.webidl @@ -27,17 +27,23 @@ dictionary MediaStreamConstraints { DOMString? peerIdentity = null; }; +// [Exposed=Window, +// Constructor, +// Constructor (MediaStream stream), +// Constructor (sequence tracks)] interface MediaStream : EventTarget { - readonly attribute DOMString id; - sequence getAudioTracks(); - sequence getVideoTracks(); - sequence getTracks(); - // MediaStreamTrack getTrackById (DOMString trackId); - // void addTrack (MediaStreamTrack track); - // void removeTrack (MediaStreamTrack track); - // attribute boolean ended; - // attribute EventHandler onended; - // attribute EventHandler onaddtrack; - // attribute EventHandler onremovetrack; - readonly attribute double currentTime; + readonly attribute DOMString id; + sequence getAudioTracks (); + sequence getVideoTracks (); + sequence getTracks (); + // MediaStreamTrack? getTrackById (DOMString trackId); + void addTrack (MediaStreamTrack track); + void removeTrack (MediaStreamTrack track); + // MediaStream clone (); + // readonly attribute boolean active; + // attribute EventHandler onactive; + // attribute EventHandler oninactive; + // attribute EventHandler onaddtrack; + // attribute EventHandler onremovetrack; + readonly attribute double currentTime; };