W3C home > Mailing lists > Public > public-media-capture@w3.org > January 2015

Re: Canceling pending getUserMedia() call

From: Jan-Ivar Bruaroey <jib@mozilla.com>
Date: Wed, 28 Jan 2015 00:29:56 -0500
Message-ID: <54C873D4.7090703@mozilla.com>
To: Iñaki Baz Castillo <ibc@aliax.net>
CC: "public-media-capture@w3.org" <public-media-capture@w3.org>
On 1/27/15 7:17 PM, Iñaki Baz Castillo wrote:
>> It sounds like you're using Google Chrome or Opera. In Firefox the gUM
>> prompt minimizes as soon as you click somewhere else, so it's not in your
>> way as much (it'll still linger in the form of an icon in the URL bar
>> though).
> That does not solve the problem I mentioned before. A new call to gUM
> would display two gUM prompts (depending on each browser, of course).

Why would you call gUM again if you already have an outstanding request?

> I still consider that a simple API would be nice to have:
> var gum = getUserMedia(....);
> [...]
> gum.cancel();  // And voila, prompt disappears.

Understood, though getUserMedia returns a promise, so you can't do 
cancel on that. ;-)

Note though that it may not be as trivial an issue to add as you seem to 
suggest, as it may open up avenues where web-page's could use repeated 
issuing and canceling of prompts over and over to pester a user into 
accepting or accidentally hitting a permission prompt.

Like it or not, there's a disincentive built into the existing behavior 
to issuing these prompts frivolously (it stays till the user addresses 
it or the page is refreshed). Not saying we shouldn't consider it, just 
that it's not obvious what the best answer is.

.: Jan-Ivar :.
Received on Wednesday, 28 January 2015 05:30:26 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 28 January 2015 05:30:27 UTC