This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 23263 - Add output device enumeration to GetSources
Summary: Add output device enumeration to GetSources
Status: RESOLVED FIXED
Alias: None
Product: WebRTC Working Group
Classification: Unclassified
Component: Media Capture and Streams (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Adam Bergkvist
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-17 13:55 UTC by Harald Alvestrand
Modified: 2013-11-23 01:10 UTC (History)
5 users (show)

See Also:


Attachments

Description Harald Alvestrand 2013-09-17 13:55:13 UTC
This is the formalization of a proposal made on the mailing list on Sept 9.

Proposal: Add output devices to the GetSources call, and add a "group" attribute for device grouping.

Rules for attribute visibility should be as for GetSources.

Example output:

{
  { 1234, "video", "First camera", group=42},
  { 7654, "audio", "First camera microphone", group=42},
  { 2345, "audio", "Headset microphone", group=17},
  { 3697, "audioOut", "Headset speakers", group=17}
}

Here, the headset microphone and speaker are part of the same device.

WebIDL changes:

- Change name of call to GetDevices
- Rename "SourceInfo" dictionary to "DeviceInfo"
- Add an attribute of type DOMString called "group"
- Add "audioOut" and "videoOut" as legal values for the "kind" attribute
Comment 1 Harald Alvestrand 2013-09-27 12:40:52 UTC
Per Sept 24, the suggestion has been made to drop videoOut from the list, because it is not well defined, so it's not clearly useful.

The editors will add this to the spec.

(boilerplate: This doesn't mean that it's definitely approved, but it does mean that someone has to suggest that it be removed in order to take it out again.)

Assigning to Adam for implementation.
Comment 2 Justin Uberti 2013-10-18 18:42:45 UTC
I think we also agreed to move get[User]Devices to navigator.

Adam, do you have an ETA for landing this? We'd like to get this wired up as soon as possible.

Harald, wdyt about keeping audio and video as "kind", and adding a separate property to indicate input vs output? "audioOut" feels a bit clunky.
Comment 3 Adam Bergkvist 2013-10-21 05:12:39 UTC
(In reply to Justin Uberti from comment #2)
> Adam, do you have an ETA for landing this? We'd like to get this wired up as
> soon as possible.

Shouldn't be that far away.
Comment 4 Adam Bergkvist 2013-10-24 05:23:40 UTC
Proposed change (rendered snapshot, links not working):

http://htmlpreview.github.io/?https://github.com/fluffy/webrtc-w3c/blob/master/getusermedia.html#enumerating-devices
Comment 5 Justin Uberti 2013-11-15 18:24:19 UTC
This change looks great. Wdyt about a corresponding .onmediadeviceschange callback to indicate when the list of media devices has changed?
Comment 6 Jói Sigurðsson 2013-11-18 13:53:47 UTC
What is the motivation for oldList? If it is just to preserve groupId members within the session, then this looks good as written. OTOH if the intent is also to preserve the internal order of devices on oldList in newList, then in step 4.1 under getMediaDevices, the fragment "move that object to resultList" should read "append that object to resultList".
Comment 7 Adam Bergkvist 2013-11-18 15:22:39 UTC
(In reply to Jói Sigurðsson from comment #6)
> What is the motivation for oldList? If it is just to preserve groupId
> members within the session, then this looks good as written. OTOH if the
> intent is also to preserve the internal order of devices on oldList in
> newList, then in step 4.1 under getMediaDevices, the fragment "move that
> object to resultList" should read "append that object to resultList".

The idea is to have the groupId stable during the session. There's no attempt to, e.g., keep a device at a stable index in the list since devices may come and go during a session.

In this context "move" = remove from oldList and append to newList.

Does that seem right? Should we clarify?

Thanks for providing feedback.
Comment 8 Jói Sigurðsson 2013-11-18 18:18:42 UTC
I would suggest changing "move to" to "append to" just so it's clear.
Comment 9 Adam Bergkvist 2013-11-19 05:27:30 UTC
(In reply to Jói Sigurðsson from comment #8)
> I would suggest changing "move to" to "append to" just so it's clear.

Works for me.
Comment 11 Justin Uberti 2013-11-23 01:10:32 UTC
Adam, any more thoughts on .onmediadeviceschange? Do you want us to propose a block of text?