Re: Promises in 1.0

2015-04-07 15:29 GMT+02:00 Harald Alvestrand <harald@alvestrand.no>:
>> Great! But just to be sure: If navigator.mediaDevices.getUserMedia
>> exists, does it mean that the whole WebRTC API supports promises?
>>
>>
>
> No, it means that getUserMedia supports promises.
>
> The legacy interface is in section 4.3.3 of the current spec; as with
> getUserMedia, the "modern" interface is the only interface where it's
> legal to omit the success callback - but unlike with getUserMedia, the
> "legacy" interfaces don't live in a separate namespace.
>
> So if you want to check if createOffer() returns a promise, you have to
> call createOffer() (no arguments) and see if a promise is returned.
>
> If only callbacks are supported, the call should fail with the WebIDL
> equivalent of "wrong number of arguments".

Ok,  my idea is to have a lib that checks all of that when loaded and
then provides a WebRTC shim/adapter. So probably it will have to
create a PC once loaded and try createOffer() without arguments.

Thanks a lot.


-- 
Iñaki Baz Castillo
<ibc@aliax.net>

Received on Tuesday, 7 April 2015 22:40:02 UTC