JSFiddle - React, Tailwind, and code Playground
by mhctoledo
HTML
<script src="https://www.youtube.com/iframe_api"></script>
<div id="player"></div>
CSS
https://youtu.be/
JavaScript
var onPlayerReady = function(event) {
event.target.playVideo();
};
// The first argument of YT.Player is an HTML element ID. YouTube API will replace my <div id="player"> tag with an iframe containing the youtube video.
var player = new YT.Player('player', {
height: 385,
width: 598,
videoId : 'VEJ8lpCQbyw',
events : {
'onReady' : onPlayerReady
}
});