[r221] User Media not requesting in Chrome on Android

  • Problem Description

    I'm trying to get cameras working in Chrome on Android, but the request to access them just isn't popping up.

    I'm testing using the Example: Webcam template built into Construct. I have a version online over here.

    I've tested it with these devices so far:

    HTC M8

    Android: 6.0

    Chrome: 48

    Galaxy Nexus

    Android 4.4.2

    Chrome: 48

    Nexus 7

    Android: 4.2.1

    Chrome: 48

    I am aware there was an issue regarding this recently that was supposedly fixed in r219. Someone else brought it up in December on here.

    User Media: work around a spec change in Chrome 47 that broke camera/microphone access

    This issue is specific to Chrome. I had a really old version of it on my Nexus 7 (31) and the user request did still appear. After it was updated, it stopped appearing. Requests work fine through the latest version of Firefox on my HTC M8.

    Attach a Capx

    Example: webcam

    Description of Capx

    Unchanged version of the basic webcam tutorial template built into Construct.

    Steps to Reproduce Bug

    • Preview in Chrome 48+ on Android
    • Click 'Get Webcam' button

    Observed Result

    The status text on the page immediately changes to "Declined!" after you hit the "Get Webcam" button.

    Expected Result

    A camera request should appear from the Chrome browser.

    Affected Browsers

    • Chrome: (YES)
    • FireFox: (NO)
    • Internet Explorer: (N/A)

    Operating System and Service Pack

    Android 6.0

    Construct 2 Version ID

    Release r221 (64-bit)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • This is not a bug: it's actually due to a recent change in Chrome. Due to security concerns, some sensitive features like webcam, microphone and geolocation accesses now require a "secure browsing context". Typically this means HTTPS, but localhost also counts. I assume you are testing with preview-over-wifi with a URL like http://192.168.0.1:50000. The problem is since this is neither localhost nor HTTPS, Chrome treats it as insecure and blocks access to sensitive features. So any requests for sensitive features are immediately declined.

    If you publish your app to a HTTPS server, it should work again. However this makes testing more cumbersome. To raise this issue with the Chrome developers I filed this report suggesting that there be an option to disable these restrictions on private IPs, which would make testing easier.

  • Thank you for clearing this up! You're correct, I added an SSL certificate to my testing domain and it's working normally now. My web host is great, so it wasn't difficult to implement at all.

  • If you see the comments in that report, it appears it's also possible to use the devtools port forwarding feature to enable this. That might help speed up testing. I think it would be easier with a browser flag though, which I'm suggesting to them.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)