메뉴얼

<button type="button" title="" onclick="play();"><span>재생</span></button>

사용자가 만든 재생 버튼, play(); 함수 호출

코드

<html>
<button type="button" title="" onclick="play();"><span>재생</span></button>
<button type="button" title="" onclick="pause();"><span>일시정지</span></button>
<button type="button" title="" onclick="stop();"><span>중지</span></button>
<br /><br />
<div id="pnl_issueVideoPlayer">
	<!-- 플래시동영상 위치 영역 -->
</div>
<script type="text/javascript" src="https://www.youtube.com/player_api"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<script type="text/javascript">
	swfobject.embedSWF('http://www.youtube.com/v/TmFZeCrV314?enablejsapi=1&amp;playerapiid=&amp;version=3&amp;showinfo=0&amp;autoplay=0&amp;rel=0', 'pnl_issueVideoPlayer', '640', '360', '10', null, null, {allowfullscreen:'true', allowScriptAccess:'always'}, {id:'ytapiplayer'});
	function onYouTubePlayerReady(playerId) {
		ytplayer = document.getElementById("ytapiplayer");
	};
	function play() { //재생
		if (ytplayer) {
			ytplayer.playVideo();
		};
	};
	function pause() { //일시정지
		if (ytplayer) {
			ytplayer.pauseVideo();
		};
	};
	function stop() { //스탑
		if (ytplayer) {
                        ytplayer.seekTo(0, true);
			ytplayer.stopVideo();
		};
	};
</script>
</html>
\\
\\

데모





api/youtube.txt · 마지막으로 수정함: 2016/10/12 16:26 (바깥 편집기)