Closed Bug 1307533 Opened 8 years ago Closed 8 years ago

getUserMedia facingmode does not work on Surface Book

Categories

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

48 Branch
defect

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox52 --- fixed

People

(Reporter: fippo, Assigned: mchiang)

Details

Attachments

(1 file)

https://jsfiddle.net/j2oe36eL/ (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. 
https://dxr.mozilla.org/mozilla-central/source/dom/media/webrtc/MediaEngineCameraVideoSource.cpp#327 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;

https://reviewboard.mozilla.org/r/88896/#review88084

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 ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/42550d2fd671
support getUserMedia facingmode on Surface Book; r=jib
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/42550d2fd671
Status: NEW → RESOLVED
Closed: 8 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.