Re: {add|remove}Track are confusing names

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(handle);

    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