Console: NotAllowedError: Permission denied (getUserMedia — camera or microphone blocked)
The user (or the browser/OS/policy) denied camera or microphone access, so navigator.mediaDevices.getUserMedia() was rejected.
NotAllowedError: Permission deniedNotAllowedError: Permission dismissedgetUserMedia NotAllowedErrorPermission denied by systemNotAllowedError: Permission denied by user agent Meaning
Permission can be denied at several layers: the site permission in the browser, the OS privacy setting for the browser, a Permissions-Policy header, or an iframe lacking the allow="camera; microphone" attribute. Reset the site permission and request it again after a user gesture.
Common causes
- User clicked Block or dismissed the prompt
- Site permission set to Block in the browser
- OS-level camera/mic privacy blocks the browser (Windows, macOS)
- Iframe without
allow="camera; microphone"or restrictivePermissions-Policy - Not a secure context (HTTP)
⚡ Quick fix
- Click the lock icon → Site settings → Camera/Microphone → Allow, then reload
- Allow the browser in the OS privacy settings
- Serve over HTTPS and add
allow="camera; microphone"to iframes
Detailed fix by platform
JavaScript
try { const s = await navigator.mediaDevices.getUserMedia({ video: true, audio: true }); } catch (e) { console.log(e.name, e.message); }— checke.name
Windows
- Settings → Privacy & security → Camera / Microphone → allow desktop apps and the browser
macOS
- System Settings → Privacy & Security → Camera / Microphone → enable the browser
Code examples
Ask after a click and handle each failure
button.onclick = async () => {
try {
const stream = await navigator.mediaDevices.getUserMedia({ video: true, audio: true });
video.srcObject = stream;
} catch (e) {
// NotAllowedError (blocked), NotFoundError (no device), NotReadableError (in use)
showHelp(e.name);
}
};How to diagnose
- Name — Exact e.name?
- Layers — Browser, OS or iframe policy?
- Context — HTTPS?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- autoplay blocked NotAllowedError: play() failed because the user didn't interact with the document first.
- Aw, Snap! Chrome: Aw, Snap! Something went wrong while displaying this webpage. Error code: STATUS_ACCESS_VIOLATION / SIGILL / Out of Memory
- captive portal Browser: This network requires you to sign in — captive portal (hotel, airport, café Wi-Fi) blocking HTTPS sites
Most viewed in Browser
Other ways to find it
Where this error sits
Origin: On your device. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 15 Oct 2026