I'm using Safari v5.1.7 on Windows 7
I want to use the javascript function: navigator.getUserMedia; to use media devices
such as a camera or microphone for audio,
The problem is that navigator.getUserMedia is always undefined
Here's my code:
navigator.getUserMedia (
{audio: true},
function(stream) {console.log('Stream: ' + e);},
function(error) {console.log('Error: ' + e);}
);
I also tried the following code, and it's also undefined:
navigator.getMedia = ( navigator.getUserMedia ||
navigator.webkitGetUserMedia ||
navigator.mozGetUserMedia ||
navigator.msGetUserMedia );
navigator.getMedia (
{audio: true},
function(stream) {console.log('Stream: ' + e);},
function(error) {console.log('Error: ' + e);}
);
How to solve this ?
Or what is its equivalent if this function isn't provided in Safari ?
Safari doesn't support WebRTC, which is the HTML5 standard that defines getUserMedia. At the moment this API will only work in Firefox and Chrome.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With