Re: Mozilla/Cisco API Proposal - listening

One question for Ian inline ....

On Jul 15, 2011, at 23:31 , Ian Hickson wrote:

> On Fri, 15 Jul 2011, Anant Narayanan wrote:
>> I would very much like for explicit connect() and listen() methods even 
>> if we do end up implementing nested event loops in Gecko. In my opinion, 
>> code just reads cleaner when you say:
>> var conn = new PeerConection(...);
>> conn.onRemoteStreamAdded = function(stream) {
>>  console.log("stream was added");
>> };
>> conn.connect();
>> instead of omitting the connect() and hoping that your 
>> onRemoteStreamAdded callback will be called magically.
> There's no magic here. The PeerConnection constructor invokes the 
> signaling callback and as soon as the ICE agent has a stream negotiated, 
> the event notifiying that a stream has been added is fired.
>> It also makes clear the distinction between streams that were added 
>> before the RTP negotiation happened, and those that were added after and 
>> sets expectations accordingly.
> No streams can be added from the remote peer before the ICE agent runs, 
> since the ICE agent is how the UA learns of the remote streams.

Just to ask a clarifying question here ... Ian, the model you are thinking of seems to be that you learn about the remote streams over the channel that the ICE is sets up. Some other people are thinking that you learn about remote streams via the messages that are passed over the out of band channel via the web servers. I can imagine either of theses working just fine but I suspect some people are thinking different things here. One of the pros of this I see is that it will probably be much less latency than other approaches. I just wanted to confirm you are thinking about it being learned over the ICE channel?

> Do you 
> mean local streams? Those wouldn't fire an event when added, so I don't 
> really follow how it would help distinguish anything.
> As far as I can tell, adding connect() would just make the API 
> error-prone: it adds no functionality, yet makes using the interface more 
> complicated (you have to do more calls).
> -- 
> Ian Hickson               U+1047E                )\._.,--....,'``.    fL
>       U+263A                /,   _.. \   _\  ;`._ ,.
> Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Saturday, 16 July 2011 16:38:51 UTC