Closed Bug 821306 Opened 13 years ago Closed 12 years ago

Expose nsIMediaDevice.id to script

Categories

(Core :: WebRTC, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla20

People

(Reporter: ted, Assigned: ted)

Details

(Whiteboard: [qa-])

Attachments

(1 file)

Not sure if this actually belongs in the DOM component. Currently MediaDevices have an ID attached, but it's not script-exposed. I'd like to be able to get at this from code with chrome privileges so that we can usefully select the correct device for unit tests.
Jesup, is this something we want to expose to webpages, and thus spec etc? If not, we should find a way to expose this only to chrome. That'll be easy down the road, but a bit tricky as of right now given how the media stuff is exposed to JS.
I didn't know it was possible for content to get a hold of these at all, honestly. I don't see anywhere that they're exposed, and there's no classinfo for it.
jst: I don't think the spec speaks to this directly. However, it's possible that as part of the 'constraints' that are given to getUserMedia it could include the 'id' of a device it was using last time as the preferred default device. The WG has talked about this only in generalities so far (no real attention), saying they'd be selected by asking for front, back, etc. But we realize on many systems there's no such labeling available. This would allow an app to adjust to the household.
Can anyone answer my question in comment 3? Is it possible for content script to get to these objects? I don't see any interfaces that expose them, and they're not in domclassinfo.
Comment on attachment 691813 [details] [diff] [review] Expose nsIMediaDevice.id to script Ted's right, there's no way to reach these from content code, the only way that I know of is to call mozGetUserMediaDevices() passing in a callback and once the callback is called, it will be handed references to media device objects. But mozGetUserMediaDevices() is only callable from chrome...
Attachment #691813 - Flags: review?(jst) → review+
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: