- From: Martin Thomson <martin.thomson@gmail.com>
- Date: Fri, 27 Feb 2015 10:18:21 +1300
- To: Stefan HÃ¥kansson LK <stefan.lk.hakansson@ericsson.com>
- Cc: Anne van Kesteren <annevk@annevk.nl>, Harald Alvestrand <harald@alvestrand.no>, "public-media-capture@w3.org" <public-media-capture@w3.org>
On 27 February 2015 at 00:33, Stefan HÃ¥kansson LK <stefan.lk.hakansson@ericsson.com> wrote: > var p = navigator.mediaDevices.getUserMedia(options); > > followed by > > p.constructor.reject(); As Anne points out, that doesn't do anything useful. What you need is either something broader: navigator.mediaDevices.getUserMedia(c) .catch(() => console.log('rejected 1')); navigator.mediaDevices.getUserMedia(c) .catch(() => console.log('rejected 2')); navigator.mediaDevices.cancelAllRequests() .then(() => console.log('cancel complete')); // > rejected 2 // order of cancel is indeterminate // > rejected 1 // > cancel complete Or something that has a more complex surface area: var gum = navigator.mediaDevices.getUserMedia(c); gum.promise.catch(() => console.log('rejected')); gum.cancel().then(() => console.log('cancel complete')); // > rejected // > cancel complete
Received on Thursday, 26 February 2015 21:18:48 UTC