i'm trying to write a script to detect when the user allow/deny the use of a microphone, using the getUserMedia API.
EDIT: I've made a fiddle to show you the issue: http://jsfiddle.net/4rgRY/
navigator.getUserMedia = navigator.getUserMedia ||
navigator.webkitGetUserMedia ||
navigator.mozGetUserMedia ||
navigator.msGetUserMedia;
if (navigator.getUserMedia) {
navigator.getUserMedia({audio: true, video: false}, function(stream) {
console.log('Yayy!');
}, function(err){
console.log("There was an error->: ",err);
});
} else {
console.log('getUserMedia not supported');
}
It works fine at Chrome but when i tried in Firefox (27 and Firefox Nightly 30a1), and you choose 'Not now', it doesn't trigger any callback, either the success or the error callbacks. So my app thinks that is allowed but doesn't work properly.
If you choose any other option in Firefox, like Always Share, Never Share or Don't Share, works fine, is just with the 'Not now' option.
Could be a Firefox bug? Or is something wrong with my code?