2013-05-25 1 views
1

페이지에서 YouTube 플레이어를 초기화하는 웹 앱 구성 요소를 만들었습니다. 이 플레이어는 주문형 비디오에 익숙해 질 것입니다. 초기화 될 때까지 플레이어를 초기화 할 때 그러나, 나는에있는 은 비디오를 전달합니다 Youtube Javascript API로 빈 플레이어 초기화

//javascript swfobject.embedSWF(makeUrl('http://www.youtube.com/v/NINOxRxze9k', { version : 3,//youtube api version autoplay : 0,//automatically start playing color : 'white',//color for the 'viewed' part of the video autohide : 0,//automatically hide the controls controls : 0,//don't show the controls disablekb : 1,//disable keyboard shortcuts enablejsapi : 1,//enable javascript api fs : 0,//disable full-screen playerapiid : id,//player api id that is used for javascript api //playlist : videoIds.join(','),//the list of video ids to play (it can be only one item) showinfo : 0,//don't show video information like title rel : 0,//don't show related videos after playback is finished theme : 'light',//use the light theme (the other one is 'dark') showsearch : 0, //don't show the search bar (it's disabled when 'rel' is 0) origin : window.location.hostname//it is a security thing necessary for enabling javascript api }), id, '300', '200', '8', null, null, params, atts); 

가 (첫 번째 줄의 'NINOxRxze9k'부분을주의).

질문 : 특정 동영상에 대해 초기화하지 않고 YouTube 플레이어를 초기화하려면 어떻게해야합니까? 나는 그것이 준비되어있는 비디오의 스냅 사진을 보여주기를 원하지 않습니다. 나는 그 위에 아무것도 연주하기 전에 그것을 비워 둡니다.

SitNote : Google's documentation에서 볼 수 있듯이 VIDEO_IDembedSWF()으로 전달됩니다. 제거를 시도했지만 작동이 멈췄습니다.

+0

내 검색과이 사람에 따르면 안된다고 생각합니다. http://stackoverflow.com/a/7828791/1460591 – YouYou

답변

1

나는이 같은 질문에 대한 대답이라고 생각하지만 플레이어 IFrame을 API를 사용하는 경우 :

Init YouTube iframe player without video ID

+0

이것은 관련이 있지만 사용중인 Javascript API에는 적용되지 않습니다 (ActionScript 3). – AlexStack

0

확실하지 않음을이 도움이 될 것입니다하지만 만약 여기 어쨌든입니다.

다른 프로젝트에서 YT-api를 플래시 및 웹에서 잠시 사용 해본 결과 많은 읽기가 필요한 LARG 시스템이라는 것을 알았습니다. 빈 플레이어를로드 한 유일한 시간은 플래시 앱입니다. 또한 크롬 멜이 필요했습니다.

나는 여기 사람들을위한 다운로드와 함께 "익숙한"튜토리얼을 했어. http://www.youtubetutsite.com/player.php?videoID=kO_WVIYdLDc

앱에서 SWF 플레이어를 사용할 때만 효과가 있습니다.