W3C home > Mailing lists > Public > public-media-capture@w3.org > October 2014

Re: Strawman Promises consensus position, based on Thursday's telechat

From: Martin Thomson <martin.thomson@gmail.com>
Date: Tue, 7 Oct 2014 15:23:07 -0700
Message-ID: <CABkgnnUUzYjgYmub2QekEDg0M=a=JAm9i2dgdBiCJRsjM5-AQQ@mail.gmail.com>
To: Adam Bergkvist <adam.bergkvist@ericsson.com>
Cc: Harald Alvestrand <harald@alvestrand.no>, "public-media-capture@w3.org" <public-media-capture@w3.org>
On 6 October 2014 23:28, Adam Bergkvist <adam.bergkvist@ericsson.com> wrote:
> There's one point above that says "navigator.getUserMedia has callbacks".
> Should this be reflected in the document, and if so, how?

I believe that navigator.getUserMedia should be defined as being equivalent to:

navigator.getUserMedia = function(constraints, successCallback,
failureCallback) {
  let result = navigator.mediaDevices.getUserMedia(constraints);
  result.then(successCallback, failureCallback);
  return result;

This removes successCallback and failureCallback from the promise
chain, but it also ensures that you don't get any weird problems when
the callbacks return promises, or throw exceptions.
Received on Tuesday, 7 October 2014 22:23:34 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:26:30 UTC