I am currently working on a script to detect when the user either allows or denies the use of a microphone using the getUserMedia API.
UPDATE: To better illustrate the issue I am facing, I have created a fiddle: 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('Success!');
}, function(err){
console.log("An error occurred->: ",err);
});
} else {
console.log('getUserMedia not supported');
}
The script works perfectly in Chrome, however when testing it in Firefox (27 and Firefox Nightly 30a1) and choosing the 'Not now' option, neither the success nor the error callbacks are triggered. This results in my application assuming that permission has been granted even though it does not work as expected.
If any other option is chosen in Firefox such as Always Share, Never Share, or Don't Share, the script functions correctly. The problem only arises with the 'Not now' option.
Is this issue possibly a bug in Firefox? Or could there be something incorrect in my code?