유투브 플레이어 동작 제어하기 | Tips

<script type="text/javascript" src="<A href="http://ajax.googleapis.com/ajax/libs/swfobject/2/swfobject.js">[removed]http://ajax.googleapis.com/ajax/libs/swfobject/2/swfobject.js"></script>

 

우선 swfobject 를 불러오고...

 

음 아래 소스와 같이..

 

var ytplayer;

function onYouTubePlayerReady(playerId) {
 ytplayer = document.getElementById("myvideo");
}

var params = {
  allowScriptAccess: "always"
 };
 var atts = {
  id: "myvideo"
 };
 swfobject.embedSWF("http://www.youtube.com/v/adfdfdfdf?enablejsapi=1&version=3", "videoCon", "600", "400", "8", null, null, params, atts);


function pause()
{
 if (ytplayer) {
        ytplayer.pauseVideo();
    }
 
}

 

 

 

그리고 html 태그 부분
 <INPUT class=more>

 

 

기타 명령어들..

 

ytplayer.loadVideoById(id, startSeconds);
ytplayer.cueVideoById(id, startSeconds);
ytplayer.playVideo();
ytplayer.pauseVideo();
ytplayer.stopVideo();
ytplayer.getState();
ytplayer.seekTo(seconds, true);
ytplayer.getVideoBytesLoaded();
ytplayer.getVideoBytesTotal();
ytplayer.getCurrentTime();
ytplayer.getDuration();
ytplayer.getVideoStartBytes();
ytplayer.mute();
ytplayer.unMute();
ytplayer.getVideoEmbedCode()
ytplayer.getVideoUrl();
ytplayer.setVolume(newVolume);
ytplayer.getVolume();
ytplayer.clearVideo(); 

youtube,swf
Comment Write
Comment List
등록된 코멘트가 없습니다.