'open cam without user permission in react js

how to open camera without user permission in react-webcam and when the user turn it off close the page


function Quiz1page1() {
const webRef=useRef(null);
const webStyle={
  position:'relative',left:'600px',top:'300px'
}

return (
  <div className='Content'>
    <fieldset className='bg-light  '>
      <p className='question  p-2' > What is the capital of England?</p>      
<input className='answers' type="text" id="text" name="fav_language" />
</fieldset>

<Link to="/Quiz1page2">
<button id='SubmitBtn' className='Next btn btn-dark mt-3 btn'>Next</button>
</Link>
<Webcam style={webStyle}  audio={false} width={350} refs={webRef} />
<br/>
  </div>
)
}


Solution 1:[1]

This is not possible on most of the devices configuration. Fortunately because that is an privacy violation act

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 parmicciano