Closed Bug 905701 Opened 11 years ago Closed 11 years ago

Support application preferences for cameras and mics in getUserMedia() prompts (B2G)

Categories

(Firefox OS Graveyard :: General, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jesup, Assigned: schien)

References

Details

(Whiteboard: [getUserMedia])

Attachments

(1 file, 1 obsolete file)

+++ This bug was initially created as a clone of Bug #905699 +++

+++ This bug was initially created as a clone of Bug #905696 +++

When implementing constraints for bug 882145, we'll need the UI to support being told that a specific device should be the default one shown to the user.  No string or other changes should occur; it's solely changing the default from the first device to a specified one. API TBD in bug 882145.

This bug is for B2G; it's especially useful on mobile devices for an app to specify 'front' or 'back' cameras as the default depending on the app in question.
Hi SC, can you handle this one? We need to pass the chosen camera(in media constrain) as default selected one in permission dialog
Flags: needinfo?(schien)
Bug 898949 is already filed for displaying available cameras in prompt UI. I suppose this bug should either modify this sequence of the available cameras or carry a default index for UI. I'll take this bug.
Assignee: nobody → schien
Depends on: 898949
Flags: needinfo?(schien)
Attached patch media-constraint-for-b2g.patch (obsolete) — Splinter Review
1. Mapping front/back camera to user/environment facing mode.
2. Invoke GetUserMediaDevices() with MediaStreamConstraints.
Attachment #802961 - Flags: feedback?(rjesup)
Attachment #802961 - Flags: feedback?(jib)
Test page, "Video" for no constraints and "Front" for facingMode='user'
http://people.mozilla.org/~schien/gum-test.html
Comment on attachment 802961 [details] [diff] [review]
media-constraint-for-b2g.patch

Review of attachment 802961 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/media/MediaPermissionGonk.cpp
@@ +443,5 @@
> +  JS::Rooted<JS::Value> temp(cx);
> +  rawConstraints.ToObject(cx, JS::NullPtr(), &temp);
> +
> +  dom::RootedDictionary<dom::MediaStreamConstraintsInternal> constraints(cx);
> +  NS_ENSURE_TRUE(constraints.Init(cx, temp), NS_ERROR_FAILURE);

GetConstraints() actually expects MediaStreamConstraintsInternal, not raw MediaStreamConstraints, so you should be able to pass in |constraints| here directly to GetConstraints() without going through rawConstraints or temp.

The rest looks good, with the caveat that I still need bz to approve all this. :-)
Attachment #802961 - Flags: feedback?(jib) → feedback+
Attachment #802961 - Flags: feedback?(rjesup) → feedback+
Add the mapping of facing mode for Firefox OS.

NOTE: bug 915705 already contains the modification for MediaStreamConstraints on Firefox OS.
Attachment #802961 - Attachment is obsolete: true
Attachment #805000 - Flags: review?(rjesup)
Attachment #805000 - Flags: review?(rjesup) → review+
No longer depends on: 898949
https://hg.mozilla.org/mozilla-central/rev/bb0967aed171
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: