Closed Bug 1919160 Opened 2 months ago Closed 19 days ago

Stop reporting facingMode on mac laptops and desktops

Categories

(Core :: WebRTC: Audio/Video, defect)

defect

Tracking

()

RESOLVED FIXED
134 Branch
Tracking Status
firefox134 --- fixed

People

(Reporter: jib, Assigned: dbaker, NeedInfo)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

STRs: On a macOS laptop, type this into web console:

"facingMode" in (await navigator.mediaDevices.getUserMedia({video: true})).getVideoTracks()[0].getSettings()

Expected result (Chrome and Safari*):

  • false

Actual result (Firefox):

  • true

This comes from the following code which I thought clever many years ago:

#ifdef XP_MACOSX
  // Kludge to test user-facing cameras on OSX.
  if (aDeviceName.Find(u"Face"_ns) != -1) {
    return Some(VideoFacingModeEnum::User);
  }
#endif

Since MBP cameras tend to be branded "FaceTime HD Camera", and are built-in to laptops, we know they're technically user-facing, and conveniently have the word "Face" in them.

In hindsight, I think this was a mistake, because:

  1. other browsers aren't doing it,
  2. seems arbitrary and inconsistent with Windows and Linux, and
  3. it trips up websites using facingMode (in getSettings() or getCapabilities()) to detect "this is a mobile browser" (phone or pad)

I think it would be better to remove this code I think, and leave facingMode to be a "mobile" property of devices with front and back cameras.

Not a regression.

Flags: needinfo?(dbaker)
Severity: -- → S2
Assignee: nobody → dbaker
Status: NEW → ASSIGNED
Pushed by dbaker@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/247e6d9d4524 Stop reporting facingMode on mac laptops and desktops;r=jib
Status: ASSIGNED → RESOLVED
Closed: 19 days ago
Resolution: --- → FIXED
Target Milestone: --- → 134 Branch
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: