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
9
votes
1 answer

Display getUserMediaStream live video with media stream extensions (MSE)

I am trying to display a MediaStream taken from a webcam using getUserMedia, and to relay it to a remote peer using whatever mechanism possible for it to be played (as an experiment). I am not using webRTC directly as I want control over the raw…
9
votes
3 answers

How to keep 1:1 aspect ratio video all the time in WebRTC

When I use this setting, the video aspect ratio is 1:1. constraints = { audio: false, video: { width: 240, height: 240 } }; However, I want WebRTC choose better resolution if exists. When I changed it to this constraints = { audio: false, …
Hongbo Miao
  • 45,290
  • 60
  • 174
  • 267
9
votes
1 answer

What constraints should I pass to getUserMedia() in order to get two video mediaStreamTracks?

I can get mediaDevices of 'videoinput' kind via navigator.mediaDevices.enumerateDevices() promise. I can get mediaStream via navigator.mediaDevices.getUserMedia(constraints) promise. What should constraints look like in order to have two video…
vadirn
  • 1,715
  • 4
  • 15
  • 16
9
votes
2 answers

how to enable screen/desktop capture in chrome?

I am able to achive it in firefox by folowing below steps: make my server https append my domain to the user preference media.getusermedia.screensharing.allowed_domains in about:config to whitelist it for screen sharing. use constraint like…
mido
  • 24,198
  • 15
  • 92
  • 117
9
votes
1 answer

Javascript to detect system's volume (sound) and audio jack plugged in

HTML5 has an onboard volume detection.
Cody Raspien
  • 1,753
  • 5
  • 26
  • 51
9
votes
0 answers

NavigatorUserMediaError: TrackStartError

I've been using an application that I made for the last month. It uses the getUserMedia() feature of the HTML5. As of 2 days, without me doing ANYTHING with the code the camera stopped working. At first I solved by getting a extra camera that I have…
fditz
  • 871
  • 9
  • 28
9
votes
1 answer

Speech recognition and getUserMedia

I'm building a web application and plan on using both speechRecognition and navigator.getUserMedia for audio input. I noticed that my desktop browser (Chrome on Mac, v. 31.0.1650.63) asks twice for permission to use the microphone. While this may be…
9
votes
2 answers

Playing and recording audio in sync with getUserMedia/Web Audio API

I'm currently working on a web-based collaborative recording platform for musicians, something like a basic DAW ported to the web (with extra social/sharing features). Anyway, my goal is to make it 100% flash-free, so I've been reading a lot about…
user1276108
  • 183
  • 2
  • 7
9
votes
2 answers

How to use webcam using Internet Explorer

Is there any way to run getUserMedia in Internet Explorer and use a webcam (without using Flash)?
user2472258
8
votes
2 answers

enumerateDevices after getUserMedia: how to find the active devices?

Is there a way to detect which device (camera, microphone) is active, given a MediaStream instance? The app I'm currently working on does simply query for such a stream and attaches it to a
DMKE
  • 4,553
  • 1
  • 31
  • 50
8
votes
2 answers

getUserMedia (Selfie) Full Screen on Mobile

I've the following constraints which are working perfectly fine over Chrome in Desktop (simulating mobile resolution) const constraints = { audio: false, video: { width: screen.width, height: screen.height …
Spotted
  • 95
  • 2
  • 5
8
votes
4 answers

MediaDevices.getUserMedia() How can I set audio constraints (sampling rate/bit depth)?

With browser Web API, I'd like to set MediaDevices.getUserMedia constraints attributes, suitable to record audio speech (voice messages), e.g. setting these parameters: mono 16bit 16KHz Here my code: const mediaStreamConstraints = { …
Giorgio Robino
  • 2,148
  • 6
  • 38
  • 59
8
votes
2 answers

how to detect main / telephoto camera from multiple back cameras with getusermedia

we want to use the back camera for scanning, and select the correct back camera - the main camera, and not the wide lens camera. newer mobile devices (for example, Samsung galaxy s10) have several front and back cameras. when calling…
scanner
  • 293
  • 3
  • 16
8
votes
3 answers

transmitted getUserMedia / MediaRecorder video format larger than requested format. How to tell?

Background: On Windows 10 I'm using getUserMedia (gUM) and MediaRecorder in Google Chrome (v71) to capture and encode a video stream. I'm using the constraints parameter to gUM to tell it I want a video format of 352x288. I'm requesting…
O. Jones
  • 103,626
  • 17
  • 118
  • 172
8
votes
0 answers

getUserMedia image capture resolution vs. html video element size

Is there a way to capture a higher resolution image than the actual width of my onscreen video element which is showing my webcam image that I intend to capture? Currently, I have set the width in getUserMedia to 1280, but my element is constrained…
RailsTweeter
  • 1,625
  • 3
  • 18
  • 33