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
,
Mar 6 2017
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...!!
,
Mar 6 2017
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!!!
,
Mar 6 2017
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
,
Mar 6 2017
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.
,
Mar 6 2017
Ok, I didn't notice it at first. I will attach an extension sample shortly. Thanks!
,
Mar 6 2017
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!
,
Mar 8 2017
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!
,
Mar 24 2017
tommi@, do you know who the right point of contact for getUserMedia() would be? |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by nyerramilli@chromium.org
, Mar 6 2017