Closed heliomsolivas closed 5 years ago
Hmm … you could circumvent this by using v-if
if I am correct.
How or when would you like to ask for permission?
After setting a special prop?
Or by setting a ref
and calling one of the instance methods?
I will try to add this as soon as possible, but feel free to open up a pull request.
As @Lorti mentioned, you can use a v-if
before instantiate the vue-dictaphone
component.
I used the below snippet to control. So I just let pass through v-if
when user clicks on an icon or when site is already allowed to use mic.
navigator.permissions.query({ name: 'microphone' }).then(function(result) {
if (result.state == 'granted') {
} else if (result.state == 'prompt') {
} else if (result.state == 'denied') {
}
})
I need to ask for user permission after some action happens on the page, this is possible? Actually it's firing when the component is mounted.