javascript - In the browser, how can I detect if a user has given microphone permissions? -


not more title. on browser, i'm requesting mic use. how can i, dev, access if they've chosen , choice made? thanks.

    window.audiocontext = window.audiocontext || window.webkitaudiocontext;     var audiocontext = new audiocontext();     var audioinput = null,     realaudioinput = null,     inputpoint = null,     audiorecorder = null;     initaudio();       function initaudio(){         if (!navigator.getusermedia) {             navigator.getusermedia = navigator.webkitgetusermedia || navigator.mozgetusermedia;             console.log("no microphone detected");         }         if (!navigator.cancelanimationframe) {             navigator.cancelanimationframe = navigator.webkitcancelanimationframe || navigator.mozcancelanimationframe;         }         if (!navigator.requestanimationframe) {             navigator.requestanimationframe = navigator.webkitrequestanimationframe || navigator.mozrequestanimationframe;         }         navigator.getusermedia({audio:true}, gotstream, function(e) {             alert('error getting audio');             console.log(e);         });       }      function gotstream(stream) {         // create audionode stream , set input devices     } 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -