do we want success and failure callbacks on addStream?

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

Received on Friday, 12 July 2013 14:32:53 UTC