W3C home > Mailing lists > Public > public-webrtc@w3.org > April 2015

Re: Can getUserMedia() get called on a callback/event ?

From: Iñaki Baz Castillo <ibc@aliax.net>
Date: Wed, 8 Apr 2015 18:42:33 +0200
Message-ID: <CALiegfkX-PC_eWxXJ_WQ9Bu75iycmHC-R79bPSrq50BLU-No+w@mail.gmail.com>
To: Martin Thomson <martin.thomson@gmail.com>
Cc: "Cullen Jennings (fluffy)" <fluffy@cisco.com>, "public-webrtc@w3.org" <public-webrtc@w3.org>
2015-04-08 18:34 GMT+02:00 Martin Thomson <martin.thomson@gmail.com>:
> On 8 April 2015 at 04:17, Iñaki Baz Castillo <ibc@aliax.net> wrote:
>> Really, still I don't understand how the apprtc demo of Google works
>> given that it automatically prompts the user for getUserMedia without
>> the need for the user to click in any button. Where is the trick? Does
>> it work if the JS lib calls gUM even before the DOM is load? but it
>> would fail if it waits for DOM "load" event, right? This is a no sense
>> IMHO.
>
>
> It works because the gUM prompt is not conditional on an engagement gesture.

Thanks, but I do not understand. In my tests calling gUM within a sync
javascript loaded before the DOM does work, but gUM within a
setTimeout or window.addEventListener('load') it does not always work
(don't remember now the exact results).

What about all those sites that do not load the JS in sync mode but by
means of requireJS or whatever?

I think the current non very well documented behavior is a not very
good approach or solution to a non very well defined security problem.


-- 
Iñaki Baz Castillo
<ibc@aliax.net>
Received on Wednesday, 8 April 2015 16:43:21 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 15:19:43 UTC