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

2015-01-09 23:24 GMT+01:00 Iñaki Baz Castillo <ibc@aliax.net>:
> OK, but I would like to 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?
>
> https://apprtc.appspot.com

OK, it works because the website calls to getUserMedia once loaded,
without waiting for any event (including "DOMContentLoaded").

This is a non practical design. What about all those JavaScript async
loaders (AMD, requireJS) etc? Those loaders execute code in callbacks
so gUM wouldn't work. What about if the JS app needs to wait until the
DOM is loaded before calling gUM? Writing the <script> tag that calls
gUM on the bottom of the <body> is just an old-fashion workaround.


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

Received on Friday, 9 January 2015 22:34:25 UTC