Closed Bug 1307533 Opened 7 years ago Closed 7 years ago

getUserMedia facingmode does not work on Surface Book


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

48 Branch



Tracking Status
firefox52 --- fixed


(Reporter: fippo, Assigned: mchiang)



(1 file) (thanks jib) demonstrates the facing mode constraint for getUserMedia. It works nicely in Microsoft Edge on the Surface Book (by Microsoft) but does not work in Firefox.

The camera names are "Microsoft Camera Front" and "Microsoft Camera Rear" respectively. could be improved to catch that.
Rank: 35
Priority: -- → P3
Assignee: nobody → mchiang
I don't have a Surface book.
Can someone help me verify this patch?
Comment on attachment 8805056 [details]
Bug 1307533 - support getUserMedia facingmode on Surface Book;

Thanks! r=me with nits

::: dom/media/webrtc/MediaEngineCameraVideoSource.cpp:342
(Diff revision 1)
>  #ifdef XP_MACOSX
>    // Kludge to test user-facing cameras on OSX.
> -  if (aName.Find(NS_LITERAL_STRING("Face")) != -1) {
> +  if (aName.Find(NS_LITERAL_STRING("Face")) != -1 ||
> +      aName.Find(NS_LITERAL_STRING("Front")) != -1) {
>      hasFacingMode = true;
>      facingMode = VideoFacingModeEnum::User;
> +  } else if (aName.Find(NS_LITERAL_STRING("Rear")) != -1) {
> +    hasFacingMode = true;
> +    facingMode = VideoFacingModeEnum::Environment;
>    }
>  #endif

The kludge you're modifying here is OSX only (for their "Facetime" camera) and should be left alone or maybe even removed (In hindsight, spotty support like this is probably a bad idea, though I relied on it for testing).

Instead, let's break out a windows-only section and model it on the android section directly above, which is almost the same, but with a comment on why it works. The surface books use "Microsoft Camera Front" and "Microsoft Camera Rear" according to fippo.
Attachment #8805056 - Flags: review?(jib) → review+
Rank: 35 → 15
Priority: P3 → P1
Pushed by
support getUserMedia facingmode on Surface Book; r=jib
Keywords: checkin-needed
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
works fine in 52.0a1 (2016-10-29), thank you!
You need to log in before you can comment on or make changes to this bug.