This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
I have an application where I need three cameras as input. It is not a phone, but a desktop with multiple cameras. I have three video elements into which I add the video streams with gUM. I would like it to be deterministic which camera is projected into which video element. Right now in Chrome I have to manually select the camera from the list of exposed cameras in settings (or the camera icon once the first camera is connected) to choose which camera the next video element will contain. The current spec proposes to introduce a "facingMode" enum to pick between cameras. Unfortunately, that is of limited use to only mobile cameras. It won't help in my case. I would prefer if the means to pick cameras was based on a more generic means of identifying cameras. Here's my proposal: In the Chrome settings list, the cameras are identified by their name. I can imagine having a "cameraName" enum in the constraints. If there are multiple cameras with the same name, a number (such as "HD Pro Webcam C920 #1") should be added (that's how VLC does it). Similarly, one could think of a "microphoneName" constraint.
Facing mode is not for camera identification/selection. It's more of a directionality indicator. What I presume you are looking for is the "sourceId" of the device.
(In reply to comment #1) > Facing mode is not for camera identification/selection. It's more of a > directionality indicator. OK, fair enough. My requirement still stands. I will rename the bug. > What I presume you are looking for is the > "sourceId" of the device. No, the sourceId does not persist after reloading the page and can thus not be used in JavaScript. What I am looking for is a persistent way to identify cameras and a means to select these cameras in a gUM call through constraints.
(In reply to comment #2) > No, the sourceId does not persist after reloading the page and can thus not > be used in JavaScript. What I am looking for is a persistent way to identify > cameras and a means to select these cameras in a gUM call through > constraints. The sourceId does indeed remain the same after a page reload. From the spec: "sourceId of type DOMString The application-unique identifier for this source. The same identifier must be valid between sessions of this application, but must also be different for other applications. Some sort of GUID is recommended for the identifier. Returned for all types of sources (video, audio, etc.). "
So what is currently implemented in Chrome as MediaStreamTrack.id and what you are referring to as MediaSourceStates.sourceId are different. I guess the examples in the spec make sense. So, this is about getting implementations. Thanks.