1

我为我的网络应用程序制作了一个组件,用于初始化页面上的 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(). 我尝试删除它,但它停止工作。

4

2 回答 2

1

我认为这是同一问题的答案,但如果您使用 Player IFrame API:

初始化没有视频 ID 的 YouTube iframe 播放器

于 2013-05-25T21:18:25.017 回答
0

不确定这是否会有所帮助,但无论如何都可以。

我在 Flash 和 Web 中为不同的项目使用了 YT-api 一段时间,发现它是一个需要大量阅读的LARG系统。我唯一一次发现它加载了空白播放器是在 Flash 应用程序中。它也需要是chromeles。

我做了一个“业余”教程,供人们在这里下载。 http://www.youtubetutsite.com/player.php?videoID=kO_WVIYdLDc

仅当您在应用程序中使用 SWF 播放器时才建议。

于 2013-06-02T15:26:20.200 回答