animatedModal youtube モーダル

<script src="js/animatedModal.min.js"></script>
<script>
$(function(){
 
	function videoControl1(action){ 
		var $playerWindow = $('#popup-YouTube-player1')[0].contentWindow;
		$playerWindow.postMessage('{"event":"command","func":"'+action+'","args":""}', '*');
	}
	function videoControl2(action){ 
		var $playerWindow = $('#popup-YouTube-player2')[0].contentWindow;
		$playerWindow.postMessage('{"event":"command","func":"'+action+'","args":""}', '*');
	}
    //demo 01
    $("#demo01").animatedModal({
	    		modalTarget:'animatedModal',
	            color:'#3498db',
	            afterOpen: function() {
		            videoControl1("playVideo");
	            },
	            afterClose: function() {
		            videoControl1("stopVideo");
	            }
    });
    $("#demo02").animatedModal({
	    		modalTarget:'animatedModal2',
	            color:'#3498db',
	            afterOpen: function() {
		            videoControl2("playVideo");
	            },
	            afterClose: function() {
		            videoControl2("stopVideo");
	            }
    });
    
});
</script>