我为我的网络应用程序制作了一个组件,用于初始化页面上的 YouTube 播放器。该播放器将用于在页面上播放非点播视频。但是,在初始化播放器时,我必须传递一个视频以进行初始化:
//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()
. 我尝试删除它,但它停止工作。