New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 698562 link

Starred by 9 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 3
Type: Bug



Sign in to add a comment

navigator.mediaDevices.getUserMedia doesn't work in a background script of a chrome extension

Reported by y.papou...@gmail.com, Mar 5 2017

Issue description

Chrome Version       : 56.0.2924.87
OS Version: OS X 10.11.6
URLs (if applicable) :
Other browsers tested: No, it's just chrome specific (chrome extension)
  Add OK or FAIL after other browsers where you have tested this issue:
     Safari 5:
  Firefox 4.x:
     IE 7/8/9:

What steps will reproduce the problem?
1. Create a chrome extension with a background script;
2. Try make a call of getUserMedia.

I do it in the following way:
navigator.mediaDevices.getUserMedia({audio: true}).
    then(mediaStream => console.log('Media stream is received, ', mediaStream)).
    catch(err => console.log('Failed getting media stream', err));

What is the expected result?
A media stream is received.

What happens instead of that?
The MediaDeviceFailedDueToShutdown error is arisen.

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

The same piece of code runs quite well when it's called in scope of a content script, but I do need it to be called within a background script scope.

Also please find below a screen shot with a console error.

UserAgentString: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36



 
Screen Shot 2017-03-05 at 10.32.40.png
91.6 KB View Download
Labels: Needs-Triage-M56
Cc: krajshree@chromium.org
Components: Platform>Extensions
Labels: Needs-Feedback
Unable to reproduce the issue in Mac 10.12.3 using chrome reported version #56.0.2924.87 and latest canary #59.0.3030.0.

Steps followed to reproduce the issue are as follows:
-----------
1. Opened dev tools and pasted the below code in console.
     navigator.mediaDevices.getUserMedia({audio: true}).
    then(mediaStream => console.log('Media stream is received, ', mediaStream)).
    catch(err => console.log('Failed getting media stream', err));
2. Prompted for microphone to be allowed.
3. Clicked on allow button.
4. Observed that media stream was received as expected.

Attaching screen cast for reference.

y.papouski@ - Could you please check this issue on latest canary #59.0.3030.0 by creating a new profile without any apps and extensions and please let us know if the issue still persist or not.
If the issue still persist then please provide a sample extension to test this issue.

Thanks...!!
698562.mp4
5.0 MB View Download
Hi, yes, thanks for a quick response, but...I am aware of that getUserMedia function works okay from the dev tools. My case is not about it at all.

I was talking and describing a problem with getUserMedia when it's called from a background script of an google chrome extension. These scenarios are quite different, aren't they?

You have called getUserMedia from a content script, but the problem is arisen when it's called within a background script.

Could you please check my words out right as it was described in my steps of the problem's reproduction?

Thanks!!!
Project Member

Comment 4 by sheriffbot@chromium.org, Mar 6 2017

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "krajshree@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Thanks....!!

In comment #2 i have also asked for a sample extension to test this issue.

This will help us in triaging the issue further.
Ok, I didn't notice it at first. I will attach an extension sample shortly.

Thanks!
Hello once again,

as I promised I am sending to you an extension sample and a small video of a problem's reproduction. Please find both files attached to this comment.

Thanks in advance!
For support.webm
3.6 MB View Download
forSupport.zip
811 bytes Download
Cc: hdodda@chromium.org
Labels: -Needs-Triage-M56 M-59 OS-Linux OS-Windows
Status: Untriaged (was: Unconfirmed)
Tested on mac os 10.12.2 , ubuntu 14.04 and windows 7 using chrome M56 #56.0.2924.87 and M59 #59.0.3035.0 and issue is reproduced.

Issue is seen from M54 and chrome behavior is different in older versions of chrome.

Marking it as untraiged , for further for further inputs on this.

Thanks!
Cc: rdevlin....@chromium.org
Owner: tommi@chromium.org
Status: Assigned (was: Untriaged)
tommi@, do you know who the right point of contact for getUserMedia() would be?

Sign in to add a comment