W3C home > Mailing lists > Public > public-webrtc@w3.org > March 2015

Re: {add|remove}Track are confusing names

From: Jan-Ivar Bruaroey <jib@mozilla.com>
Date: Tue, 17 Mar 2015 20:46:13 -0400
Message-ID: <5508CAD5.7060407@mozilla.com>
To: Justin Uberti <juberti@google.com>, Martin Thomson <martin.thomson@gmail.com>
CC: "public-webrtc@w3.org" <public-webrtc@w3.org>
On Tue, Mar 17, 2015 at 3:09 PM, Martin Thomson 
<martin.thomson@gmail.com <mailto:martin.thomson@gmail.com>> wrote:
>     void removeTrack(RTCRtpSender sender);
>     I don't even know where to start with this.  Where's the track?

It's not that weird when we consider:

    var handle = pc.addTrack(track, stream);

    pc.removeTrack(pc.addTrack(track, stream));

>     Why not?
>     RTCRtpSender create[Track]Sender(MediaStreamTrack track, MediaStream
>     stream, MediaStream... others);
>     void remove[Track]Sender(RTCRtpSender sender);

I think the creation of a sender object is peripheral to intent here. 
Also dislike create/remove pair.

Why create a sender? To add a track to peerConnection.
Why add a track to peerConnection? To send it.

On 3/17/15 8:02 PM, Justin Uberti wrote:
> That said, I agree that removeTrack(sender) is a bit awkward; we could 
> just as easily make that removeTrack(track || sender).

That has legs I think.

.: Jan-Ivar :.
Received on Wednesday, 18 March 2015 00:46:44 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:18:04 UTC