Trying to record audio, DOMException: Permission denied
See original GitHub issueThis is a follow-up to #802. Here’s a tiny sample app I made with Vue and Capacitor 1.0.0-beta.8 that tries to open an audio source and play it back out the speaker.
<template>
<div>
<p>Hello, world!</p>
<audio ref="audioOut" autoplay controls style="display: none;"></audio>
</div>
</template>
<script>
export default {
async mounted() {
const stream = await navigator.mediaDevices.getUserMedia({audio: true, video: false});
this.$refs.audioOut.srcObject = stream;
},
}
</script>
I have also added <uses-permission android:name="android.permission.RECORD_AUDIO" />
to android/app/src/main/AndroidManifest.xml
When I install this on my Phone (OnePlus 5, Android 8.1) I get no audio playback, and the Chrome USB debugger, I see DOMException: Permission Denied
. I can retrigger than error by running navigator.mediaDevices.getUserMedia({audio: true, video: false})
from the Chrome console.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Google chrome DOMException: Permission denied by ...
I had to go to Site Settings -> View Permissions and Data stored across all sites -> Find my Site -> Click Reset...
Read more >Microphone/Camera "Permission denied" message - Mac
If your browser's Microphone/Camera permissions are not properly set, you will see “Permission denied” on the classroom login screen.
Read more >DOMException: could not start audio source when trying to ...
What went wrong? When we try to access it we get the following error: `DOMException: could not start audio source`
Read more >How to solve "Permission to use microphone denied" error
If you see the following error below, it means Dictanote cannot access your microphone. In this article, we present two methods, both of......
Read more >MediaDevices.getUserMedia() - Web APIs | MDN
If the user denies permission, or matching media is not available, ... async function getMedia(constraints) { let stream = null; try ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Can you try also adding
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
? As I pointed out on #802 it’s also necessary for getting the audio recording. I have that one and can’t reproduce.Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.