Fenix: [Bug] MediaDevices.getUserMedia() opens "Back facing camera" by default

Created on 18 May 2020  路  11Comments  路  Source: mozilla-mobile/fenix

Steps to reproduce

  1. Navigate to WebRTC basic getUserMedia demo
  2. Click the "Open camera" button

Expected behavior

It should prompt to select between "Back facing camera" and "Front facing camera" the same way that Firefox stable does (see screenshot below).
Screenshot (May 18, 2020 20UNITO-UNDERSCORE!43!UNITO-UNDERSCORE!59)!

Actual behavior

After giving camera permissions, it does not ask which camera to use, but instead uses the "Back facing camera" by default. All other Chromium based browsers (Chrome, Brave, Vivaldi) do not ask either but they open the "Front facing camera".

Device information

  • Android device: Motorola One (XT1941-4)
  • Fenix version: Nightly 200518 06:00 (Build #21390610)
SitePermissions S2 gecko 馃悶 bug

All 11 comments

This depends on bz-1380795

Copying comment 1 from Bugzilla in case it is helpful to website devs.

As a side-note, commercial face-calling sites like appear.in really should not be relying on browser defaults, instead requesting the user-facing camera explicitly, with the facingMode constraint. [1] - Ironically, Chrome defaulting to the front camera (and not supporting facingMode yet) is liekly why sites aren't doing this right...

[1] https://stackoverflow.com/questions/32086122/getusermedia-facingmode/32364912#32364912

@liuche can we prioritize this bug? We should be providing users with the option to select between back and front camera.

GeckoView example app shows the camera selection doorhanger when requesting video. I wonder if there is something Fenix have to do in order to enable it.

This landed, so it will be in the next GV Nightly. I'd say we can QA this on Monday 9/21.

Re-testest on the latest Nightly build 9/21 with Google Pixel 4 XL (11) and Samsung Galaxy S10+ (10).
Note that I'm still able to reproduce this issue as there is no prompt asking for the front or back camera.
Also, note that the same behavior is on the following browsers: Google Chrome, Brave, Samsung Internet, Vivaldi.
The only browser I was able to select between front and back camera was Opera.

Opera
20200921-101418
Vivaldi
20200921-101338

For the example from the description, all the above-mentioned browsers never asked for front or back camera.
Removing the eng:qa:needed until further notice.

Just tested on the latest Nightly build (Build #2015765171). There is no prompt to select the camera if no facingMode constraint is set. But at least, it now opens the front facing camera by default.

Also tested Samsung S20+ with the latest Nightly build (Build #2015765555) on https://test.webrtc.org, there is no camera detected at all.
Works fine on Chrome for Android though.

See my bug report here too: https://github.com/mozilla-mobile/fenix/issues/15023

I think this bug is handled at least to parity standards with Chrome. Adding a dropdown to select the camera should be filed as a feature request.

Adding a dropdown to select the camera should be filed as a feature request.

I made it.

Everyone now can focus on #15993 if there are any change for this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

phileastv picture phileastv  路  3Comments

vesta0 picture vesta0  路  3Comments

clitetailor picture clitetailor  路  3Comments

csadilek picture csadilek  路  3Comments

softvision-miralobontiu picture softvision-miralobontiu  路  3Comments