title: problems with react-webcam
body: <p>I have a problem with react-webcam which is when I open my page immediately it asks me for permission to open my camera, but what I need is to ask for my permission only if I press the button to take a picture</p>
  <pre><code>const WebcamCapture = () =&gt; {
    const webcamRef = React.useRef(null)
    const [imgSrc, setImgSrc] = React.useState(null)
  
    const capture = React.useCallback(() =&gt; {
      const imageSrc = webcamRef.current.getScreenshot()
      setImgSrc(imageSrc)
    }, [webcamRef, setImgSrc])
  
    return (
      &lt;div&gt;
        &lt;div className=&quot;w-full bg-dark-20 flex justify-center items-center relative &quot;&gt;
          &lt;AiOutlineCamera className=&quot;text-6xl py-60 h-auto absolute m-auto&quot; /&gt;
          &lt;Webcam
            className=&quot;w-full h-64&quot;
            audio={false}
            ref={webcamRef}
            screenshotFormat=&quot;image/jpeg&quot;
          /&gt;
        &lt;/div&gt;
        &lt;div className=&quot;flex justify-end mt-5&quot;&gt;
          &lt;button
            className=&quot;text-xs flex justify-center items-center px-4 py-2 border-2  border-dark-80 rounded&quot;
            onClick={capture}&gt;
            Usar Camara web &lt;BiWebcam className=&quot;ml-2 text-base&quot; /&gt;
          &lt;/button&gt;
        &lt;/div&gt;
        {imgSrc &amp;&amp; &lt;img src={imgSrc} /&gt;}
      &lt;/div&gt;
    )
  }
  export default WebcamCapture
  </code></pre>