Questions tagged [getusermedia]

Access to media data streams--webcam video, microphone audio--from browser Javascript. Abbreviated gUM

getUserMedia provides access to data streams from media devices such as webcams and microphones. It is used from Javascript running in a user's web browser. It supports the development of front-end web application code for capturing media.

Support varies from browser to browser and device to device. See CanIUse.com for up-to-date information.

getUserMedia forms part of browser-resident WebRTC support (see ). It can be used by itself without establishing WebRTC connections.

getUserMedia is often abbreviated gUM. It's often used in conjunction with MediaRecorder; see .

Further references:

See also:

1098 questions
24
votes
2 answers

getUserMedia lock focus/exposure

I am using navigator.getUserMedia with constraints to access the user's webcam, using the feed as the source of an HTML
Jody Heavener
  • 2,704
  • 5
  • 41
  • 70
24
votes
3 answers

Get media details(resolution and frame rate) from MediaStream object

I am capturing the user's camera, i want to catch the picture with the best resolution possible, so my code is something like the snippet below, I want to read the resolution details from the incoming stream, so i can set it as video height and…
mido
  • 24,198
  • 15
  • 92
  • 117
23
votes
2 answers

NotReadableError: Could not start source

I have added this piece of code in my project if (navigator.mediaDevices === undefined) { navigator.mediaDevices = {}; } if (navigator.mediaDevices.getUserMedia === undefined) { navigator.mediaDevices.getUserMedia = function (constraints) { …
php_nub_qq
  • 15,199
  • 21
  • 74
  • 144
20
votes
3 answers

How to capture audio in javascript?

I am currently using getUserMedia(), which is only working on Firefox and Chrome, yet it got deprecated and works only on https (in Chrome). Is there any other/better way to get the speech input in javascript that works on all platforms? E.g. how do…
user2212461
  • 3,105
  • 8
  • 49
  • 87
20
votes
3 answers

How can I capture an image via the user's webcam using getUserMedia?

I want to make a program on the web which will capture an image via the user's webcam. I am using the getUserMedia Web API. Here is my code, but it does not work. How can I change it to capture the webcam image?
PumpkinSeed
  • 2,945
  • 9
  • 36
  • 62
19
votes
7 answers

Google chrome DOMException: Permission denied by system for navigator.mediaDevices.getUserMedia

It's November of 2019, this JavaScript code works in FireFox (70.0.1 (64-bit)), Safari (13.0.2 (15608.2.30.1.1)), Opera (Version:65.0.3467.48), On a Windows Chrome Version 70.0.3538.77 (64-bit), this code works. but NOT in MacOS Google Chrome…
Morris
  • 948
  • 2
  • 9
  • 22
18
votes
3 answers

getUserMedia constraints ignored on Safari 12

For some reason Safari 12 (haven't tried on other versions) is completely ignoring getUserMedia constraints. My code looks something like this navigator.mediaDevices.getUserMedia({ video: { facingMode: 'environment', width: { …
Kkulikovskis
  • 2,028
  • 16
  • 28
18
votes
1 answer

Can't choose right webcam in Google Chrome

I can't choose right webcam in Google Chrome. Chrome detects my webcams correctly, but I am unable to chose one of them from list because it is in a disabled state where Chrome is always choosing Facetime HD Camera instead of the default webcam that…
Alex Goncharov
  • 319
  • 1
  • 2
  • 6
18
votes
3 answers

Chrome Extension - getUserMedia throws "NotAllowedError: Failed due to shutdown"

I have a suite which records the user's webcam and mic. It works great on a webpage, but in a Chrome Extension the line: navigator.mediaDevices.getUserMedia({video: true, audio: true}) .then(this.record.bind(this)) .catch(VidRA.error); is…
Mitya
  • 33,629
  • 9
  • 60
  • 107
18
votes
2 answers

Blob video duration metadata

I am writing a software that manipulates camera stream video in firefox. I am generating a Blob with video type recorded with MediaRecorder API. What i am doing to save the blob as video in local storage is using FileSaver library : …
Valere
  • 201
  • 2
  • 9
18
votes
7 answers

GetUserMedia - facingmode

I am currently using an Android tablet and GetUserMedia to take pictures in my program. Apparently, the default camera used by GetUserMedia is the front camera. How do I use the rear camera as a default? Here's my code for GetUserMedia: …
Mikhail
  • 201
  • 1
  • 2
  • 4
18
votes
7 answers

stop the webcam streaming of getUserMedia without page refreshing

I am trying to close the webcam with javascript function (it has to be closed after receive some Ajax response), but it seems impossible to close without refreshing the page. All the methods for close it like video.src = null, video.pause...etc…
user2158954
  • 231
  • 1
  • 3
  • 8
17
votes
2 answers

How can I disable automatic gain control (AGC) in WebRTC web-apps such as Google Hangouts or OpenTokRTC

In pre-WebRTC googletalkplugin days, one could disable AGC (automatic gain control for the microphone) by adding audio-flags: 1 to the config file. However, since Google Hangouts now use WebRTC, it often happens that while I'm chatting with someone,…
Charl Botha
  • 4,373
  • 34
  • 53
17
votes
2 answers

getUserMedia() video size in Firefox & Chrome differs

I'm using getUserMedia(), and when implementing constraints (see below) they only work in Chrome and not Mozilla. The size in mozilla always appears stretched and ends up bigger than the one in chome. var vid_constraints = { mandatory: { …
sidewaiise
  • 1,445
  • 3
  • 16
  • 27
17
votes
1 answer

HTML5 Microphone capture stops after 5 seconds in Firefox

I'm capturing audio input from microphone with getUserMedia() function, works fine in chrome, but in firefox sound dies out after 5 seconds. If I send request for microphone again (without reloading the page) same thing happens. Here is the code (I…
Starwave
  • 2,352
  • 2
  • 23
  • 30
1
2
3
73 74