[r221] User Media not requesting in Chrome on Android

Report Construct 2 bugs here.

Post » Fri Feb 12, 2016 8:46 am

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)
B
12
S
5
Posts: 28
Reputation: 1,558

Post » Fri Feb 12, 2016 3:10 pm

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.
Scirra Founder
B
397
S
236
G
88
Posts: 24,420
Reputation: 194,549

Post » Fri Feb 12, 2016 11:12 pm

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.
B
12
S
5
Posts: 28
Reputation: 1,558

Post » Mon Feb 15, 2016 11:52 am

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.
Scirra Founder
B
397
S
236
G
88
Posts: 24,420
Reputation: 194,549


Return to Bugs

Who is online

Users browsing this forum: No registered users and 0 guests