New issue
Advanced search Search tips

Issue 593455 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Mar 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Issue with navigator.getUserMedia() when "selecting a camera on google chrome 44

Reported by christop...@gmail.com, Mar 9 2016

Issue description

Chrome Version       : Version 49.0.2623.87 m
URLs (if applicable) :
Other browsers tested: none

OS = Windows 7 FAmily


What steps will reproduce the problem?
(1) go to url 192.168.1.12:8080/wPda (this is an application)
(2) The page served by the application lists all cameras on the pc
(3) The user selects one camera (from a select box previously populated
(4) navigator.webkitGetUserMedia() is invvoked as follows (where videoSource is the id (device.deviceId) of the camera as follows:
function startSelectedCamera(videoSource) {
	var constraints = {
		    audio:  false,
		    video: {
		      optional: [
		        {sourceId: videoSource}
		                                 ]
		    }
		  };
                     navigator.getUserMedia(  constraints,
					      function(stream) {
						  videoStream = stream;
						  // Stream the data
						  video.src = createSrc(stream);
						  video.play();
						},
						function(error) {
						    	  alert('Starting video error: '+ error.code);
						    	  console.log("Video capture error: ", error.code);
				      });
What is the expected result?

I expect thi sinvocation to start the selected camera. Instead the "error" fall back reports an error (error.code=undefined)

What happens instead?
Instead the "error" fall back reports an error (error.code=undefined)
This "error" is not documented anywhere, nor can I find any explanation for it

Please provide any additional information below. Attach a screenshot if
possible.

If NO camera is selected the cameras start fine after selection by the user
In this case the constaints object is: {video: true,audio: false}

On an EARLIER version of Google Chrome (39/ Android 5) the code that fails (step 4) works pefectly fine

if instead of 192.168.1.12 (or any IP Address) the URL is localhost:8080/wPda step 4 works perfectly fine on Chrome 44 

This has been puzzling me for weeks now, and I  have not made any progress. ANy help is welcome.

Regards to those who will read this post

Christophe


 
Labels: Te-NeedsFurtherTriage
When report has not garnered much attention so far. So let me contribute to it myself with some more information or guess work:

It looks like a security thing as Chrome might raise barriers when a "remote" or "untrusted" web site attemps to "manipulate" the cameras via some Javascript. In other words Chrome prevents web sites from messing around with your workstation.

This is of course fine and dandy, but there are cases where this is an overkill.

Any IP@ does not mean that the browser displays pages served by a web site. IT can also mean that  it displays pages served by a trusted application on a company's own network, in which case there is no danger.
This is exactly the case here as the application (a blook banking app) simply uses the camera to read barcodes

Finally what na I /Should I do to get some feedback? This is the first time I post a report here and I am not sure I am doing it right

As I wrote earlier I did not get much feedback. But I kept on investigating or at least trying to understand what was happening.

I will make a long stroy short:
Since a recent (exact id unknown... to me at least) of Chrome, getUserMedia() CANNOT be accessed by a web page (JAvascript in the web page) if the protocole is HTTP. An I have to say that this makes a lot of sense.

So to make the getUserMEdia() work pages must be served over the HTTPS protocol (with a convincing enough certificate)

That is all so far

Cc: dtapu...@chromium.org
Status: WontFix (was: Unconfirmed)
See this page
https://www.chromium.org/Home/chromium-security/deprecating-powerful-features-on-insecure-origins

and related issues.

Sign in to add a comment