title: How to play HTML5 Video in full screen on button click in react js
body: <p>I'm trying to show video in fullscreen on click of external button.I tried with ref and document.getElementByid() .It was throwing error for requestFullscreen().Is there any other way to achieve this.</p>
  
  <pre><code>  const fullScreenVideoRef=useRef(null);
    const  onShowVideo=()=&gt;{
    if (fullScreenVideoRef.current.requestFullscreen) {
              marioVideo.current.requestFullscreen();
          }
          else if (fullScreenVideoRef.current.msRequestFullscreen) {
              marioVideo.msRequestFullscreen();
          }
          else if (fullScreenVideoRef.current.mozRequestFullScreen) {
              marioVideo.current.mozRequestFullScreen();
          }
          else if (fullScreenVideoRef.current.webkitRequestFullScreen) {
              marioVideo.current.webkitRequestFullScreen();
          }
     }
  </code></pre>
  
  <pre><code>  &lt;video muted autoPlay loop controls id="full-screenVideo" ref={fullScreenVideoRef} &gt;
                          &lt;source src="/video/web-experience-cdn.mp4" type="video/mp4"/&gt;
    &lt;/video&gt;
  </code></pre>