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

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

From: Iñaki Baz Castillo <ibc@aliax.net>
Date: Fri, 9 Jan 2015 23:33:36 +0100
Message-ID: <CALiegfkxahuQYt2++=LENr0Lku7kDjsw5L_MGnZy5+euP0yt2Q@mail.gmail.com>
To: Martin Thomson <martin.thomson@gmail.com>
Cc: "public-webrtc@w3.org" <public-webrtc@w3.org>
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
Received on Friday, 9 January 2015 22:34:25 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:18:03 UTC