Re: do we want success and failure callbacks on addStream?

I think we should use a callback on addStream


On Jul 12, 2013, at 8:39 AM, piranna@gmail.com wrote:

> Since the errors showed are due to checks on the data givent to
> addStream, it makes sense to raise the error just on that point and
> not on an undefined time later, so I think is better throw an
> exception or add an error callback, and seems the last one is a better
> idea, not only due to the "main thread issue" but also to force people
> to be consciente of this use case.
> 
> 2013/7/12 Jim Barnett <Jim.Barnett@genesyslab.com>:
>> This topic came  up while Adam was trying to clean up some open issues on
>> the WebRTC spec.   Someone (Mozilla?) has asked that we add success and
>> failure  callbacks to addStream.  On the other  hand, the consensus of the
>> group up to this point seems to have been that addStream doesn’t do much,
>> and that the real work occurs later when you create and apply an offer or
>> answer (so no need for success and failure callbacks on addStream).
>> However, under the current definition, addStream does throw errors in
>> certain cases.  Specifically:
>> 
>> 
>> 
>> --- from spec ---
>> 
>> 5. Parse the constraints provided by the application and apply them to the
>> MediaStream, if possible. If the constraints could not be successfully
>> applied, provide an RTCError object of type INCOMPATIBLE_CONSTRAINTS to the
>> failure callback.
>> 
>> 
>> 
>> 6. If the stream has a peerIdentity constraint set and the PeerConnection is
>> in a connected state, check that the remote identity matches the constraint.
>> If there is no match, provide an RTCError object of type
>> INCOMPATIBLE_CONSTRAINTS to the failure callback.
>> 
>> ---
>> 
>> 
>> 
>> 
>> 
>> So do we want to:
>> 
>> 
>> 
>> 1.        Add success and failure callbacks to addStream?
>> 
>> 2.       Move the two checks above to createOffer/createAnswer (and leave
>> addStream without callbacks)?
>> 
>> 
>> 
>> We could also consider throwing  exceptions in the two cases listed above,
>> but that  would mean doing the related processing in the main thread, and we
>> are trying to avoid doing anything that might block the  main thread.
>> 
>> 
>> 
>> -          Jim
>> 
>> 
> 
> 
> 
> -- 
> "Si quieres viajar alrededor del mundo y ser invitado a hablar en un
> monton de sitios diferentes, simplemente escribe un sistema operativo
> Unix."
> – Linus Tordvals, creador del sistema operativo Linux
> 

Received on Wednesday, 24 July 2013 03:33:20 UTC