JSFiddle - React, Tailwind, and code Playground

HTML

<div class="container">
  <div class="curtain">

    <!-- 1. Video Wrapper Container -->
    <div class="embed-youtube" data-video-id="djV11Xbc914">
      <!-- 2. The preview button that will contain the Play icon -->
      <button class="embed-youtube-play" type="button" aria-label="Open"></button>
    </div>


  </div>
</div>

CSS

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background: white;
}


.container {
  position: absolute;
  left: 0;
  right: 0;
  min-height: 100%;
  display: flex;
  padding: 8px 8px;
}

.curtain {
  flex: 1 0 0;
  margin: auto;
  max-width: 640px;

  position: relative;
}

.embed-youtube {
  background-color: #000;
  margin-bottom: 100px;
  position: relative;
  height: 0;
  padding-top: 56.25%;
  overflow: hidden;
}

.embed-youtube.five {
  margin-bottom: 0;

}

.embed-youtube img {
  width: 100%;
  top: -16.84%;
  left: 0;
  opacity: 1;
}

/*.embed-youtube img,
.embed-youtube .embed-youtube-play {
  cursor: default;
}*/

.embed-youtube img,
.embed-youtube iframe,
.embed-youtube .embed-youtube-play,
.embed-youtube .embed-youtube-play:before {
  position: absolute;
}

.embed-youtube iframe {

  height: 100%;
  width: 100%;
  top: 0;
  left: 0;


}

.embed-youtube .embed-youtube-play {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  margin: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  cursor: pointer;
  border: 9px solid blue;
  background: transparent;
  filter: drop-shadow(3px 3px 3px #000000b3);

  z-index: 1;

}

.embed-youtube-play::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 20px solid transparent;
  border-bottom: 20px solid transparent;
  border-left: 27px solid blue;
  transform: translateX(4px);
}

.embed-youtube-play:hover {
  box-shadow: 0 0 0 5px rgba(43, 179, 20, 0.5);
}

.embed-youtube-play:focus {
  outline: 0;
  box-shadow: 0 0 0 5px rgba(0, 255, 255, 0.5);
}

JavaScript

(function() {
  let YouTubeContainers = document.querySelectorAll(".embed-youtube");

  // Iterate over every YouTube container you may have
  for (let i = 0; i < YouTubeContainers.length; i++) {
    let container = YouTubeContainers[i];
    let imageSource = "https://img.youtube.com/vi/" + container.dataset.videoId + "/sddefault.jpg";

    // Load the Thumbnail Image asynchronously
    let image = new Image();
    image.src = imageSource;
    image.addEventListener("load", function() {
      container.appendChild(image);
    });

    // When the user clicks on the container, load the embedded YouTube video

    const addImageToContainer = function(container, image) {
      container.appendChild(image);
    };

    container.querySelector("button").addEventListener("click", function() {
      let iframe = document.createElement("iframe");

      iframe.setAttribute("frameborder", "0");
      iframe.setAttribute("allowfullscreen", "");
      iframe.setAttribute("allow", "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture");
      // Important: add the autoplay GET parameter, otherwise the user would need to click over the YouTube video again to play it 
      iframe.setAttribute("src", "https://www.youtube.com/embed/" + container.dataset.videoId + "?rel=0&showinfo=0&autoplay=1&fs=0");

      // Clear Thumbnail and load the YouTube iframe
      container.innerHTML = "";
      container.appendChild(iframe);
    });
  }
})();