ページ上の YouTube プレーヤーを初期化する Web アプリ用のコンポーネントを作成しました。このプレーヤーは、ページ上のアンデマンド ビデオに使用されます。ただし、プレーヤーを初期化するときは、初期化するためのビデオを渡す必要があります。
//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 プレーヤーを初期化するにはどうすればよいかということです。再生する準備ができているビデオのスナップショットを表示したくありません。何かを再生する前に空白にしたいのです。
サイトノート: Google のドキュメントからわかるように、VIDEO_ID
は に渡されembedSWF()
ます。削除しようとしましたが、機能しなくなりました。