I want to re-prompt for camera permission if the user denies it the first time.
Code:
navigator.mediaDevices.getUserMedia({video: true, audio: false}).then(function(){
document.getElementById("submitbutton").style.display="inline";
}).catch(function(err){alert("Please provide consent.");location.reload();});
The above code reloads the page after I deny the permission the first time. But after reload, it does not prompt for permission rather it again goes into the .catch block
I believe this is happening because the browser stores the denied promise the first time itself and check the same promise on page reload.
Is there any way I can force the permission prompt to appear again?