Re: Promises in 1.0

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