Re: Canceling pending getUserMedia() call

2015-01-28 1:04 GMT+01:00 Jan-Ivar Bruaroey <jib@mozilla.com>:
> On 1/27/15 5:25 PM, Iñaki Baz Castillo wrote:
>>
>> Is there anyway to make the pending gUM prompt to disappear?
>
>
> See
> http://stackoverflow.com/questions/14492450/cancelling-a-getusermedia-request

Thanks, but location.reload() is not a valid solution. I do not want
to reload the website at all.


>> I mean:
>> without waiting for the user to press "Accept" and then ignoring and
>> closing the given MediaStream.
>
>
> 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).
I really mean a way to make the existing gUM prompt to really
disappear (no hidden icons, no page reload).


>> In that scenario and given that the user does know that the
>> call/session has ended, he may prefer to click on "Deny" (why to open
>> my webcam when the call has already ended?), which would cause the
>> website to get into the gUM blacklist of the browser.
>>
>> Found nothing in the spec.
>
>
> Again, those are tied to non-spec-mandated choices of Chrome and Opera to
> interpret Deny as permanent AFAIK (Firefox has explicit "Don't Share" and
> "Never Share" options).
>
> Implementations use slightly different models for the gUM prompt, with pros
> and cons. On that topic, we've been going over our gUM permission workflow
> and have been meaning to raise some issues for the spec. We hope to post
> something about that here soon.

I still consider that a simple API would be nice to have:

var gum = getUserMedia(....);
[...]
gum.cancel();  // And voila, prompt disappears.


Thanks a lot.


-- 
Iñaki Baz Castillo
<ibc@aliax.net>

Received on Wednesday, 28 January 2015 00:18:27 UTC