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 17243 - suggestion on "select camera function for getUserMedia()"
Summary: suggestion on "select camera function for getUserMedia()"
Alias: None
Product: WebRTC Working Group
Classification: Unclassified
Component: WebRTC API (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Web RTC Working Group
QA Contact:
Depends on:
Reported: 2012-05-30 07:56 UTC by Yang Sun
Modified: 2013-01-29 07:20 UTC (History)
6 users (show)

See Also:


Description Yang Sun 2012-05-30 07:56:22 UTC
now there is navigator.getUserMedia() function for html5
But JavaScript can only return 1 stream returned by getUserMedia can capture the stream by successCallback.

For example:
function successCallback(stream)
  video.src = URL.createObjectURL(stream)

Now when we develop some face detection feature using html5, we have 2 or more camera connect to browser, but only by browser UI can we choose which camera can we use.We can not let JS to choose which camera can use, then use JS to manipulate the camera chosen for face detection.

So, can we in future HTML let getUserMedia return references for all available cameras connect to browser in a array, so we can iterate streams and let JS to choose the one we want for later processing, Or in some 3D scenario, to manipulate multiple streams from cameras to show some 3D scene. for example a better quality camera for face detection. 

And streams Array returned by getUserMedia can contain quality information (1 standard for 1 mega-pixel, 5 standard for mega-pixel )or optionally the description of the camera, so JS can choose by filtering or comparision.

For example:
function successCallback((Array type)streams)
 if streams(i).quality>5
Comment 1 Cullen Jennings 2012-10-24 19:16:48 UTC
I think is being discussed at TPAC
Comment 2 Yang Sun 2012-10-25 00:39:33 UTC
list on this TPAC's agenda?

(In reply to comment #1)
> I think is being discussed at TPAC
Comment 3 Harald Alvestrand 2012-10-25 08:26:48 UTC
Media Capture Task Force: 

Bullet point "Device enumeration API"
Comment 4 Yang Sun 2012-10-25 08:28:40 UTC
Any material for introduction to Device enumeration API?

(In reply to comment #3)
> Media Capture Task Force: 
> Bullet point "Device enumeration API"
Comment 5 j.chetwynd 2013-01-28 18:59:09 UTC hosts what you may consider a workaround
plug 2 cameras in, visit page

wfm recent Chrome

filed bug: Support more than one camera at a time


Comment 6 Cullen Jennings 2013-01-28 19:07:15 UTC
this needs to be discussed on the list not in bug tracker.
Comment 7 j.chetwynd 2013-01-28 22:37:16 UTC
#6 Cullen,

this bug should not be closed by you as fixed.

No action has as yet been taken that results in that state being achieved.
Comment 8 Harald Alvestrand 2013-01-29 07:20:03 UTC
Please contribute to We are not using the bugzilla for requesting new features.