Question

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 ?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top