W3C home > Mailing lists > Public > public-webrtc@w3.org > July 2013

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

From: <piranna@gmail.com>
Date: Fri, 12 Jul 2013 16:39:07 +0200
Message-ID: <CAKfGGh3d5uLFr5KQKAa2JNkL9bSz7Ub9roYnqNxTnzMx1-MBRQ@mail.gmail.com>
To: Jim Barnett <Jim.Barnett@genesyslab.com>
Cc: "public-webrtc@w3.org" <public-webrtc@w3.org>
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 Friday, 12 July 2013 14:39:55 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 15:19:34 UTC