JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://www.youtube.com/player_api"></script>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<div> Hover on the anchor links to play related videos</div>
<a class="playvid" href="#player"> Play video 1 </a>
<br/>
<br/>
<br/>
<a class="playvid" href="#player2"> Play Jquery video</a>
<br/>
<br/>
<br/>

<iframe style="display:none" id="player" width="385" height="230" src="https://www.youtube.com/embed/erDxb4IkgjM?rel=0&wmode=Opaque&enablejsapi=1;showinfo=0;controls=0" frameborder="0" allowfullscreen></iframe>
<iframe style="display:none" id="player2" width="385" height="230" src="https://www.youtube.com/embed/hMxGhHNOkCU?rel=0&wmode=Opaque&enablejsapi=1;showinfo=0;controls=0" frameborder="0" allowfullscreen></iframe>

JavaScript

var players =[];// an array where we stock each videos youtube instances class
$(function() {
  var playvideo = function() {
    var id = $(this).attr("href");
    $(id).show();
    var pid = id.replace("#", "")
    players[pid].playVideo();
  }
  var stopvideo = function() {
    var id = $(this).attr("href");
    $(id).hide();
    var pid = id.replace("#", "")
    players[pid].stopVideo();
  }
  //Bind to anchor mouse enter and leave event. This can be a div or any HTML element
  $(".playvid").mouseenter(playvideo).mouseleave(stopvideo);
});

function onYouTubeIframeAPIReady() {
  var videos = $('iframe'), // the iframes elements
    playingID = null; // stock the current playing video
  for (var i = 0; i < videos.length; i++) // for each iframes
  {
    var currentIframeID = videos[i].id; // we get the iframe ID
    //alert(currentIframeID);
    players[currentIframeID] = new YT.Player(currentIframeID); // we stock in the array the instance
  }
}
onYouTubeIframeAPIReady();