Questions tagged [mediadevices]

148 questions
15
votes
1 answer

Check if browser/platform support screen capturing via `getDisplayMedia`

We can request a media stream to a screen or windows via navigator.mediaDevices.getDisplayMedia(). However, this immediately prompts the user to decide which kind of capturing to use. I need to check if the browser/platform even support screen…
Lukas Kalbertodt
  • 79,749
  • 26
  • 255
  • 305
15
votes
5 answers

getUserMedia - how to detect if the device actually has a camera

I'm playing with the html5/javascript getUserMedia api to write a js app that will use the device's camera if available. I'm using Modernizr to detect the capability (of the browser) like this: if (Modernizr.getusermedia) { And within the true…
Nathan Russell
  • 3,428
  • 5
  • 30
  • 51
11
votes
2 answers

What camera communication standards are used by Navigator.MediaDevices.getUserMedia()?

Does anyone know what communication standards are being used to detect camera hardware for use with getUserMedia? I presume that it's MTP or something like that, although I expect that the implementation is different for each browser/OS, but I've…
Nanhydrin
  • 4,332
  • 2
  • 38
  • 51
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 get a media stream of the speaker's output to transfer it over the network or record it?

I'm trying to get the output of the speaker and then do what ever I want with this stream . I tried to use this to get the speaker's stream: var mySpeakerStream = new MediaStream(); navigator.mediaDevices.getUserMedia({audio: {deviceId : {exact:…
6
votes
1 answer

MediaDevices.enumerateDevices() is not showing all the media devices when accessing via file protocol?

My index.html to list all media devices is