I am trying to get the input from a webcam and microphone, this is the code that I am using:
var constraints = {audio: true, video: true};
var promise = navigator.mediaDevices.getUserMedia(constraints);
promise.then(function(stream) {
/* use the stream */
console.log(stream);
})
.catch(function(err) {
/* handle the error */
console.log(err);
});
However navigator.mediaDevices is undefined. This is running on an http server however I have the option Develop->WebRTC->Allow Media Capture on Insecure sites.
Any help is greatly appreciated! Thank you