W3C home > Mailing lists > Public > public-webrtc@w3.org > April 2015

Re: Promises in 1.0

From: Harald Alvestrand <harald@alvestrand.no>
Date: Tue, 07 Apr 2015 14:58:01 +0200
Message-ID: <5523D459.2030909@alvestrand.no>
To: Iñaki Baz Castillo <ibc@aliax.net>, "public-webrtc@w3.org" <public-webrtc@w3.org>
Den 07. april 2015 14:20, skrev Iñaki Baz Castillo:
> Hi,
> 
> I don't fully understand why the whole API has moved from callbacks to
> promises just when 1.0 seems close to frozen. Anyhow ok, it's done.
> 
> However, how could the JS detect whether the underlying WebRTC stack
> in the browser supports callbacks and/or promises?

Just ignore the difference-hiding libraries, and call:

thePromise = navigator.mediaDevices.getUserMedia()

If this function exists, you have a new browser.

The old callback-compatible interface is navigator.getUserMedia.
Received on Tuesday, 7 April 2015 12:58:31 UTC

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