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

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

From: Jan-Ivar Bruaroey <jib@mozilla.com>
Date: Fri, 09 Jan 2015 15:34:29 -0500
Message-ID: <54B03B55.4010202@mozilla.com>
To: Iñaki Baz Castillo <ibc@aliax.net>, "public-webrtc@w3.org" <public-webrtc@w3.org>
On 1/9/15 11:19 AM, Iñaki Baz Castillo wrote:
> To be clear, the following "fails" in Chrome:
>
> --------------
> setTimeout(function() {
>      getUserMedia(
>          {video:true},
>          function() {},
>          function(error) { console.error(error); }
>      )
> }, 2000);
> --------------
>
> It "fails" since the "getUserMedia" prompt is not displayed until the
> user moves to another tab or application and comes back to this one.

Are you sure? Works for me in Chrome (39 and Canary) 
http://jsfiddle.net/jib1/k3u0zjzx

Works from localhost too (I know Chrome doesn't allow gUM from file:// 
urls...)

.: Jan-Ivar :.
Received on Friday, 9 January 2015 20:34:58 UTC

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