getusermedia

Navigator.mediaDevices.getUserMedia not working on iOS 12 Safari

爷,独闯天下 提交于 2019-12-01 03:39:32
As of iOS 12, navigator.mediaDevices.getUserMedia() is returning an error in Safari. To recreate this, open iPhone Web Inspector , then run this snippet in the console: var constraints = { audio: true, video: { width: 1280, height: 720 } }; navigator.mediaDevices.getUserMedia(constraints) .then(function() { console.log('getUserMedia completed successfully.'); }) .catch(function(error) { console.log(error.name + ": " + error.message); }); You'll see that this runs successfully in desktop browsers, and in iOS 11 Safari, but fails in iOS 12 Safari. NotAllowedError: The request is not allowed by

getUserMedia() in JavaScript normalizes across browsers. Illegal Invocation

江枫思渺然 提交于 2019-12-01 03:18: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 read it's a context issue. But I still couldn't understand what's the meaning of that. In the first

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

你。 提交于 2019-12-01 02:24:14
问题 HTML5 has an onboard volume detection. <video controls width="320" height="176" onvolumechange="alert('The volume has been changed')"> This is for the player only. Is it possible to detect volume from the system? Say a phone. Can I get volume readings of my phone from the mobile browser? Or can I use JS to detect if the audio jack is plugged in? Can Volume level be detected for audio out using GetUserMedia? 回答1: Short answer for this is no! This is how web-browsers have been made for a very

How to upload RecordRTC blob file to Rails paperclip in AJAX

若如初见. 提交于 2019-11-30 16:43:35
On the client side, the user uses RecordRTC to record a short video. When the user presses upload, I will get the video's blob data using recorder.getBlob() , and upload it to my server (using Rails and paperclip to handle file upload). At first, I wanted to change the <input type='file'> field value to the blob data. It turns out that for security in browsers, I cannot change it using javascript. Then, I tried to use AJAX: $("#ajax-submit").on("click", function() { var data = new FormData(); data.append("record[video]", recorder.getBlob(), (new Date()).getTime() + ".webm"); var oReq = new

How to upload RecordRTC blob file to Rails paperclip in AJAX

喜你入骨 提交于 2019-11-30 16:12:37
问题 On the client side, the user uses RecordRTC to record a short video. When the user presses upload, I will get the video's blob data using recorder.getBlob() , and upload it to my server (using Rails and paperclip to handle file upload). At first, I wanted to change the <input type='file'> field value to the blob data. It turns out that for security in browsers, I cannot change it using javascript. Then, I tried to use AJAX: $("#ajax-submit").on("click", function() { var data = new FormData();

Accessing Multiple camera javascript getusermedia

旧时模样 提交于 2019-11-30 15:32:25
guys i have two cameras that is -the web camera -the laptop camera i want to stream those camera in a website i already have some reference here is some code that is working on jsfiddle here <video id="video" width="640" height="480" autoplay></video> <button id="snap" class="sexyButton">Snap Photo</button> <canvas id="canvas" width="640" height="480"></canvas> <script> // Put event listeners into place window.addEventListener("DOMContentLoaded", function() { // Grab elements, create settings, etc. var canvas = document.getElementById("canvas"), context = canvas.getContext("2d"), video =

how to enable screen/desktop capture in chrome?

拈花ヽ惹草 提交于 2019-11-30 13:23:27
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 {video: {mediaSource: "screen"}} , but in chrome, I am getting totally lost. most places keep telling: You'll need to first enable the flag called Enable screen capture support in getUserMedia() in chrome://flags. ( but I am unable to find this flag anywhere) I have checked Muaz Khan's screen share plugin , it works great, but afraid that it is coupled with

TypeError: 'getUserMedia' called on an object that does not implement interface MediaDevices

牧云@^-^@ 提交于 2019-11-30 10:19:23
I'm trying to implement a webcam into a website using a video tag. It works in Chrome, but FireFox and IE return errors in the console. Anyone have any ideas why? Thank you! Code: navigator.getMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mediaDevices.getUserMedia || navigator.msGetUserMedia || OTPlugin.getUserMedia; Firefox error:TypeError: 'getUserMedia' called on an object that does not implement interface MediaDevices. IE error: Unable to get property 'getUserMedia' of undefined or null reference You forgot navigator.mozGetUserMedia for Firefox. IE doesn't

Take photo when the camera is automatically focused

会有一股神秘感。 提交于 2019-11-30 09:49:12
问题 On my web, I need users can upload photos. But to make sure that the images are not blurry, I'd like to automatically detect that the camera is auto-focused or find a way to help focus. How can I take a photo automatically when the camera focuses correctly? Any idea?? My code: navigator.getUserMedia = (navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia); var options = {video: true}; var videoWidth, videoHeight; var video = document

How can I capture an image via the user's webcam using getUserMedia?

血红的双手。 提交于 2019-11-30 07:04:22
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? <div id="container"> <video autoplay="true" id="videoElement"> </video> </div> <script> </script> There is the JS: var video = document.querySelector("#videoElement"); navigator.getUserMedia, elem = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia || navigator.oGetUserMedia; console.log(navigator.getUserMedia); if