Youtube Video Modal Popup keeps playing after closing in ASP.Net

Last Reply on Nov 07, 2013 08:07 AM By Mudassar

Posted on Nov 07, 2013 01:27 AM

Hello, here: http://www.aspsnippets.com/Articles/Play-YouTube-Video-inside-AJAX-Modal-Popup-in-ASPNet.aspx you explain how to use a modal popup to show a youtube video.

 

I am doing the same thing with my code below however when I exit the popup the youtube video continues to play. Can you please help me get it so it stops playing when I exit the modal popup? Thank you!

<asp:UpdatePanel ID="upYouTube" runat="server" UpdateMode="Conditional">
	<ContentTemplate>
		<asp:ImageButton ID="ClickToPlayYoutube" runat="server" Visible="False" src="Assets/VideoPlayerImages/ViewYouTubeVideo.png" alt="YouTube Video" /> 
		<asp:Panel ID="pnlYoutubePopup" runat="server" Height="315px" Style="display:none;" CssClass="W2M_ModalPopup">
			<asp:Panel ID="pnlYoutube" runat="server">	 
				<asp:PlaceHolder ID="phYouTubeEmbedded" runat="server"></asp:PlaceHolder>
			</asp:Panel>	 
			<asp:ImageButton AutoPostBack="true" ID="ibCancelYoutube" runat="server" Text="Close" CausesValidation="false" ImageUrl="../Assets/VideoPlayerImages/close.png" />
		</asp:Panel>
	<ajaxToolkit:ModalPopupExtender ID="SendEmailPopupDialogYoutube" runat="server" TargetControlID="ClickToPlayYoutube"  PopupControlID="pnlYoutubePopup" BackgroundCssClass="modalBackground" CancelControlID="ibCancelYoutube" DropShadow="false"/>
	</ContentTemplate>
</asp:UpdatePanel>

 

Posted on Nov 07, 2013 08:07 AM

Yes this is it.

I will update the sample thanks