Camera access from browser not possible

REPRODUCIBILITY: 100%
BUILD ID: Sailfish OS 3.3.0.16 (Rokua)
HARDWARE: Jolla C
UI LANGUAGE: English
REGRESSION: ?

DESCRIPTION:

I need to scan QR codes on event tickets from a web application, but it seems the browser cannot access the camera. I have tried it with several browser: native Sailfish OS browser, Firefox, Chromium, Bud Browser, … always the same.
I need that function for my job, so any help is highly appreciated… Thank you!

PRECONDITIONS:

Scanning from that web application works fine on my collegues’ phones (iPhones and Samsung)

STEPS TO REPRODUCE:

  1. log in to the web application (that’s why there’s no use in posting the specific url - a personal login is required)
  2. Press “Start” inside the scanning web application - that’s where other phones ask for permission for camera access or simply start the camera - and where I get an error message

EXPECTED RESULT:

camera access from browser

ACTUAL RESULT:

Error messages:
“no navigator.mediaDevices.enumerateDevices” (native Sailfish browser, Chromium, Bud Browser)
“NotAllowedError: The request is not allowed by the user agent or the platform in the current context.” (Firefox)

7 Likes

As a stop-gap, have you tried using an Android browser?
I realize the runtime provided on the Jolla C was hopelessly out of date essentially already when it shipped, but none the less it’s worth a try.

Thank you for your reply! Yes I have tried with Firefox and Chromium (from an Android store) and Bud Browser (from Jolla Store)… unfortunately didn’t work :\

Hey, i know Opera has become even more niche since the arrival of Chrome browser. But for me accessing the camera for qr-code scanning works under Android on a Xperia X with Android 4.4 Android support :slight_smile:

I just installed and tried Opera, same error message (no navigator.mediaDevices.enumerateDevices), unfortunately… Thank you anyway! :slight_smile:

I never tested it before like i am using opensource Barcode Scanner for this, but apparently all barcodes can be read (e-mail, contact, text) exept for webpages, then nothing happens

I had the same problem using https://app.vg-dresden.de. In the up right is a symbol of a barcode. Pressing this symbol tries to use the camera. This wasn’t working for me to. I used firefox, webcat and default sailfish browser. Nothing worked.
But some days ago i tried to activate my firefox account on my XA2. At the firefox account page you can set an account picture. I tried this button and then firefox asked for permission to acces the camera. So I could take pictures out of firefox. After that the camera also worked at the above maintained webpage.
So it looks like it is just a problem of permissen. If you set the permission manually in android settings, it should work for you to.

This works here, for example, in the Kiwi browser. The first time you access the camera you will be asked whether you want to allow or block access to the camera.

When you go with the stock Browser to https://de.webcamtests.com/ then you get this:

and with Kiwi Browser this:

1 Like

Thank you @luddwig27 and @s_mario! I tried webcamtests.com and there camera access was perfectly possible. However camera access was still not working in the web application I need to work with - so the problem seems to be with that application. That doesn’t really solve my question but at least I think it’s not my phone’s fault :wink: will have to find a workaround with another device. Thanks again to everybody!

With 4.4.0.58 sailfish browser can now access both cameras from Xperia X on the site “de.webcamtests.com” as videoinput#1 and videoinput#2.
But on the site “app.vg-dresden.de/scanner” you can only choose "Droid front camera, “Droid rear camera” is not offered for selection.

@ollabanolla - maybe you have now more success with your web application

+1 for this.

I was surprised to see a little barcode next to the search box on a site I use (requires login to access relevant page so pointless sharing link).

Unfortunately clicking it only brings up the option of using the “Droid front camera”, making it difficult to scan a barcode as intended.

Not sure if it’s a missing feature or a bug. In any case, a new thread should be opened.

Access to the browser should now be possible (since at least 4.4.0, possibly earlier), and we also have a related topic on the forum where it would probably make sense for any further discussion to continue.

I’m therefore tagging this as fixed, and also closing the topic. If this causes any issues for anyone, please send me a private message and we can re-open it.