getusermedia
HTML5 getUserMedia record webcam, both audio and video
MediaStreamRecorder is a WebRTC API for recording getUserMedia() streams( still under implementation) . It allows web apps to create a file from a live audio/video session. <script language=”javascript” type=”text/javascript”> function onVideoFail(e) { console.log(‘webcam fail!’, e); }; function hasGetUserMedia() { // Note: Opera is unprefixed. return !!(navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia); } if (hasGetUserMedia()) … Read more
NotReadableError: Failed to allocate videosource
NotReadableError is the spec compliant error thrown by Firefox when webcam access is allowed but not possible. Most commonly this happens on Windows because the webcam is already in use by another app. Firefox will throw this error on both Windows and Mac even though only on Windows processes get exclusive access to the webcam. … Read more
Change sample rate of AudioContext (getUserMedia)
As far as I know, there is no way to change the sample rate within an audio context. The sample rate will usually be the sample rate of your recording device and will stay that way. So you will not be able to write something like this: var input = audio_context.createMediaStreamSource(stream); var resampler = new … Read more
Converting WAV to any compressed audio format in client-side JavaScript
I’ve made an audio recorder that records to mp3 directly from the browser combining RecorderJS and libmp3lame.js You can find the gitHub project here: https://github.com/nusofthq/Recordmp3js and a more detailed explanation of the implementation: http://nusofthq.com/blog/recording-mp3-using-only-html5-and-javascript-recordmp3-js/
getUserMedia() in chrome 47 without using https
getUserMedia allows you to listen in to the private conversations of the user. If it were enabled over unencrypted HTTP, this would allow an attacker to inject code that listens in and sends the conversations to the attacker. For example, if you if you are in a private conference room of a hotel with unencrypted … Read more
Is it possible to control the camera light on a phone via a website?
Here is a little “torch-app” for a website: Edit 1: I also made a jsfiddle //Test browser support const SUPPORTS_MEDIA_DEVICES = ‘mediaDevices’ in navigator; if (SUPPORTS_MEDIA_DEVICES) { //Get the environment camera (usually the second one) navigator.mediaDevices.enumerateDevices().then(devices => { const cameras = devices.filter((device) => device.kind === ‘videoinput’); if (cameras.length === 0) { throw ‘No camera found … Read more
Turn off webcam/camera after using getUserMedia [duplicate]
localstream.stop() has been depreciated and no longer works. See this question and answer: Stop/Close webcam which is opened by navigator.getUserMedia And this link: https://developers.google.com/web/updates/2015/07/mediastream-deprecations?hl=en#stop-ended-and-active Essentially you change localstream.stop() to localstream.getTracks()[0].stop(); Here’s the source in the question updated: <html> <head> <script> var console = { log: function(msg) { div.innerHTML += “<p>” + msg + “</p>”; } … Read more
Sending a MediaStream to host Server with WebRTC after it is captured by getUserMedia
You cannot upload the live stream itself while it is running. This is because it is a LIVE stream. So, this leaves you with a handful options. Record the audio stream using one of the many recorders out there RecordRTC works fairly well. Wait until the stream is completed and then upload the file. Send … Read more
reprompt for permissions with getUserMedia() after initial denial
jeffreyveon’s answer will help reduce the chance that your user will choose deny, since she will only have to choose once. In case she does click deny, you can provide a message that explains why you need the permission and how to update her choice. For example: navigator.getUserMedia ( // constraints { video: true, audio: … Read more