getusermedia

getusermedia DevicesNotFoundError thrown in latest browsers

眉间皱痕 提交于 2019-12-30 11:21:12
问题 I have been using getUserMedia() for WebRtc for a while now but since the latest update of browsers I have not been able to use this. On previous versions worked fine. Affected browsers' versions Firefox - 57.0.4 , Chrome - 63.0.3239.132 Example code: navigator.getUserMedia({ "audio": true, "video": false }, function (stream) { console.log(stream); localStream = stream; },logError); Also check this if anyone is getting this error in google sample code https://webrtc.github.io/samples/src

getusermedia DevicesNotFoundError thrown in latest browsers

你。 提交于 2019-12-30 11:21:07
问题 I have been using getUserMedia() for WebRtc for a while now but since the latest update of browsers I have not been able to use this. On previous versions worked fine. Affected browsers' versions Firefox - 57.0.4 , Chrome - 63.0.3239.132 Example code: navigator.getUserMedia({ "audio": true, "video": false }, function (stream) { console.log(stream); localStream = stream; },logError); Also check this if anyone is getting this error in google sample code https://webrtc.github.io/samples/src

WebRTC resolution limit

拥有回忆 提交于 2019-12-30 09:26:25
问题 I tried this and this, but the maximum resolution I can get is 640x480. The pictures taken by other windows apps by the same camera have the resolution of 1600x1200. Is there any limit for resolution in WebRTC? I cannot find any official documentation about that. 回答1: You can do it by using constraints and passing those to getUserMedia as shown in the links you provided. It's possible that your webcam only supports 640x480 for video and higher resolutions for still images (this is common).

getUserMedia() in JavaScript normalizes across browsers. Illegal Invocation

一曲冷凌霜 提交于 2019-12-30 08:12:10
问题 When I try to do the following: var getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia; // now I try to invoke it with some parameters: getUserMedia(...) // not working! It throws an error "Illegal Invocation" in Chrome. But if I do: navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia; // now invoke it with the navigator navigator.getUserMedia(..) // Works I've tried searching a bit, and I

Microphone activity level of WebRTC MediaStream

▼魔方 西西 提交于 2019-12-30 00:55:11
问题 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 WebRTC javascript API. 回答1: When microphone has audio the green bar up and down very nice: <script type="text/javascript"> navigator.webkitGetUserMedia({audio:true, video:true}, function(stream){ // audioContext = new webkitAudioContext(); deprecated

How to concat chunks of incoming binary into video (webm) file node js?

▼魔方 西西 提交于 2019-12-24 17:54:53
问题 I am trying to upload chunks of base64 to node js server and save those chunks into one file let chunks = []; app.post('/api', (req, res) => { let {blob} = req.body; //converting chunks of base64 to buffer chunks.push(Buffer.from(blob, 'base64')); res.json({gotit:true}) }); app.post('/finish', (req, res) => { let buf = Buffer.concat(chunks); fs.writeFile('finalvideo.webm', buf, (err) => { console.log('Ahh....', err) }); console.log('SAVED') res.json({save:true}) }); Problem with the above

Canvas URL to download image

瘦欲@ 提交于 2019-12-24 13:33:47
问题 just need to get the url of canvas/image to insert the link to download <a href=IMAGE URL HERE" download="image">Save Image</a> I have the following code... <script> (function(){ var ctx=canvas.getContext('2d'); var localMediaStream=null; function sizeCanvas(){ setTimeout(function(){ canvas.width=video.videoWidth; canvas.height=video.videoHeight; img.height=video.videoHeight; img.width=video.videoWidth; },100);} function snapshot(){ ctx.drawImage(video,0,0); img.src=canvas.toDataURL('image

getUserMedia not capturing the screen correctly

旧巷老猫 提交于 2019-12-24 05:53:05
问题 Using the following code: function captureScreen(size) { navigator.webkitGetUserMedia({ audio: false, video: { mandatory: { chromeMediaSource: 'desktop', minWidth: size.width, maxWidth: size.width, minHeight: size.height, maxHeight: size.height, minFrameRate: 1, maxFrameRate: 1 } } }, gotStream, getUserMediaError); function gotStream(stream) { var video = document.createElement('video'); video.addEventListener('loadedmetadata',function(){ var canvas = document.createElement('canvas'); canvas

chrome.desktopCapture - can't record both system audio and microphone?

倖福魔咒の 提交于 2019-12-24 01:37:08
问题 I've built a Chrome extension that captures screen activity and microphone input and outputs a video file. Since chrome.desktopCapture can't record audio input alongside screen capture, I'm getting the mic in its own, separate stream. So: //get screen stream chrome.desktopCapture.chooseDesktopMedia(['screen'], null, (stream_id, opts) => { let constraints = {video: mandatory: { chromeMediaSource: 'desktop', chromeMediaSourceId: stream_id }}; navigator.mediaDevices.getUserMedia(constraints)

HTML5 audio recording not woorking in Google Nexus

江枫思渺然 提交于 2019-12-23 19:37:39
问题 I want to use HTML5 getusermedia to record audio, play back and save to server. I am trying with Google Nexus (Android 4+) and Google Chrome 29. Is it possible? When I try the codes I got from net, it asks permission to record using microphone and using the phone, I save a wav file. But no sound on playing this. The same site works from chromium browser in my PC. Am I doing anything wrong? or is it that audio recording is not actually working as it claims? Thanks 回答1: We now have Web Audio