Re: Question: how should addTrack work in relation to createOffer et. al.?

On 4/30/15 1:35 PM, Stefan Håkansson LK wrote:
> On 30/04/15 18:10, Jan-Ivar Bruaroey wrote:
>> function received(offer) {
>>      pc.setRemoteDescription(offer);
>>      pc.createAnswer().then(answer => {
>>        pc.setLocalDescription(answer);
>>
>>        pc.addTrack(trackX);
>>        pc.createOffer(); // queued until stable state!
>>        pc.addTrack(trackY);
>>      });
>> }
>>
>> Excluding trackY here would be a feat, as it gets added way before
>> createOffer runs (in have-remote-offer). Also, why want that?
> I agree. And in this example, createOffer would be queued until
> pc.setLocalDescription(answer) resolves as well, right?

Right.

> (And ideally I guess the app should make sure that setLocal(answer)
> didn't fail before moving on with adding tracks and making a new offer).

Ideally yes (this is an example of what you can do, not what you should do).

.: Jan-Ivar :.

Received on Thursday, 30 April 2015 19:32:38 UTC