Recorderjs icon indicating copy to clipboard operation
Recorderjs copied to clipboard

callback function if user has allowed access to microphone in browser

Open hp-techbucket opened this issue 9 years ago • 1 comments

i want to call a custom function, when user allowed access to microphone from browser alert . how can we do that. i need to do that in my custom js . please help me.

hp-techbucket avatar Apr 26 '16 04:04 hp-techbucket

function myFunction () {
... some code
}

navigator.getUserMedia({audio:true,video:false}, ( myFunction, console.log "You must run this on https, or localhost for it to work")

Be careful, this is a callback on an asynchronous function, so the value of your 'this' is not going to be the same as its executing context. Use JS bind if you need access to the original context.

ortonomy avatar Nov 29 '16 08:11 ortonomy