0
votes

I had YouTube Channel and I Had Web Page on my web site which display this video ,I diplay the viedo in ModalPopupExtender ,and I had problem when I finsihed from displaying this video and close ModalPopupExtender the sound of viedo still displaying.

So please any one help me.

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

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

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

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) + " from [YouTubeVideos] Where MV='Yes'" ; SqlCommand Com = new SqlCommand(Sql, con); Com.CommandType = CommandType.Text;

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

    }
}
1
Have you got any code we can see?m.edmondson

1 Answers

1
votes

Because the only thing you do is to change the visibility of your div which contains the youtube player, the video will keep playing till end. You need to use youtube javascript player api to control the player and stop video with command "player.stopVideo():Void" when user closes the modal popup.

Please review http://code.google.com/apis/youtube/js_api_reference.html#Functions for further information and examples.