JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<script>
var params = { allowScriptAccess: "always" };
var atts = { id: "player1" };
swfobject.embedSWF("http://www.youtube.com/v/wSqdIXPnf-I?enablejsapi=1&playerapiid=player1&version=3",
"player1-container", "425", "356", "8", null, null, params, atts);
function onYouTubePlayerReady(id)
{
alert('Ready: ' + id);
var player1 = document.getElementById('player1');
player1.playVideo();
player1.addEventListener("onStateChange", "onytplayerStateChange");
}
function onytplayerStateChange(newState) {
alert("Player's new state: " + newState);
if(newState == 3)
{
player1.pauseVideo()
}
}
</script>
<div id="player1-container">
You need Flash Player version 8 or higher to view this content.
</div>