首页 文章

如何在YouTube Channels 中显示视频?

提问于
浏览
0

我在我的网站上有YouTube Channels 和我有网页显示这个视频,我在ModalPopupExtender中显示了视频,当我显示这个视频并关闭ModalPopupExtender关闭仍然显示的视频时,我遇到了问题 .

所以请任何人帮助我 .

'id = "Image" runat = "server" width = "96" height = "86" alt = "Video" />

'> ' type = "application/x-shockwave-flash" allowscriptaccess = "always" allowfullscreen = "true" width = "400" height = "320">


<%----%> <%----%>'/>

protected void Page_Load(object sender,EventArgs e){string LanguageID = Globals.GetSuitableLanguage(Page); Page.Title = Globals.Translate(Page.Title,Page); if(!IsPostBack){GetAllYouTube(); }

} private void GetAllYouTube(){using(SqlConnection con = Connection.GetConnection()){string Sql =“select id,url,Image,”Globals.Translate(“YoutubeTitle_EN”,Page)“来自[YouTubeVideos]其中MV ='是''; SqlCommand Com = new SqlCommand(Sql,con); Com.CommandType = CommandType.Text;

SqlDataReader dr = Com.ExecuteReader();
        DataList2.DataSource = dr;
        DataList2.DataBind();

    }
}

1 回答

  • 1

    因为您唯一要做的就是更改包含youtube播放器的div的可见性,视频将一直播放到最后 . 当用户关闭模态弹出窗口时,您需要使用youtube javascript player api来控制播放器并使用命令“player.stopVideo():Void”停止视频 .

    请查看http://code.google.com/apis/youtube/js_api_reference.html#Functions以获取更多信息和示例 .

相关问题