title: Keeping react-player full-screen mode between videos
body: <p>I am building an online course website.
  When the user watches a lesson in full-screen mode, I want to remember that, so as to use full-screen mode when I mount <code>react-player</code> with the next lesson. I hoped there would be an <code>onFullscreenMode</code> callback, but the documentation does not list anything of the kind. How can I achieve this?</p>
  <p><strong>Edit 1:</strong> Based on the reply of @onkarruikar, I tried using screenfull. First, I was surprised that it was not installed although <code>real-player</code> was supposed to use it to enter full-screen mode. After installing the package and importing it, I get the compilation error:</p>
  <pre><code>.../node_modules/screenfull/index.js 11:44
  Module parse failed: Unexpected token (11:44)
  File was processed with these loaders:
  .../node_modules/babel-loader/lib/index.js
  You may need an additional loader to handle the result of these loaders.
  | 
  |   for (const methodList of methodMap) {
  &gt;     const exitFullscreenMethod = methodList?.[1];
  | 
  |     if (exitFullscreenMethod in document) {
  </code></pre>
  <p><strong>Edit 2:</strong> I also don't get it why the <a href="https://cookpete.com/react-player/" rel="noreferrer">demo</a> uses a custom button for switching to full-screen mode, whereas I see a button (<a href="https://i.stack.imgur.com/I5p2r.png" rel="noreferrer"><img src="https://i.stack.imgur.com/I5p2r.png" alt="enter image description here" /></a>) on the player itself:</p>
  <p><a href="https://i.stack.imgur.com/BmH4H.png" rel="noreferrer"><img src="https://i.stack.imgur.com/BmH4H.png" alt="enter image description here" /></a></p>