Re prompt for Camera permission in JS after initial denial
No, you can't.
This is a deliberate decision on the part of the browser designers to prevent websites from becoming annoying with their (potentially invasive) permission requests. Once a user has rejected the permission request, they have to dig into their browser settings to re-allow requests from that domain. Read more here.
A trick that has become popular, though, is to not ask for permission until after the user has done something that indicates they actually want the feature indicated.
So, for example, you may want your user flow to go something like:
- Determine if user has already granted permission in the past without asking for it.
- If not, show a message that says "To use this feature we need access your camera and microphone. Click here to grant permission."
- Once they click that acknowledgement, then and only then, ask for the permission.
If you're going to invade the user's privacy, it will go best for you if you explain why you're doing it.