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:

964 questions
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
  • 2,615
  • 6
  • 40
  • 71
19
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
  • 12,762
  • 17
  • 59
  • 123
19
votes
2 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
  • 20,728
  • 10
  • 84
  • 109
17
votes
1 answer

iOS 11 getUserMedia not working?

Apple released a statement that getUserMedia will be fully functional on iOS 11. After installing iOS 11 Beta version 5, I do get a message that my website requests access to my camera and microphone, but it seems that the line: video.src =…
Koby Douek
  • 14,709
  • 15
  • 58
  • 84
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
  • 3,928
  • 30
  • 48
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,051
  • 1
  • 16
  • 22
17
votes
2 answers

How can I get the size of the webcam image with getUserMedia?

I'm trying to find out what will be the size of the image I get from the webcam using getUserMedia. Right now, in my Macbook, I have supposedly a 720p camera, but the image I'm getting is 640x480. I'm assuming this won't always be the case, though,…
Daniel Magliola
  • 27,613
  • 56
  • 154
  • 235
16
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
  • 1,750
  • 11
  • 24
16
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
  • 181
  • 1
  • 8
16
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,395
  • 5
  • 30
  • 55
16
votes
3 answers

Microphone activity level of WebRTC MediaStream

I would like some advice on how best to get the microphone activity level of an audio MediaStreamTrack javascript object in Chrome/Canary. The MediaStreamTrack object is an audio track of the MediaStream returned by getUserMedia, as part of the…
user1710407
  • 471
  • 1
  • 5
  • 15
16
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
  • 211
  • 1
  • 3
  • 8
15
votes
8 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
  • 171
  • 1
  • 1
  • 4
14
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,255
  • 2
  • 13
  • 24
14
votes
1 answer

Encode audio from getUserMedia() to a .OGG in JavaScript

So I have this HTML5 project I'm working on, where I'm converting an iOS app to a web-based one. Accompanying part of the content creation of the app is an audio recording, which I'm trying to replicate in JavaScript without the use of plugins; so…
twchapman
  • 227
  • 2
  • 8
1
2
3
64 65