Current location: Hot Scripts Forums » Programming Languages » ASP.NET » Embed YouTube movie not load... in Popup window


Embed YouTube movie not load... in Popup window

Reply
  #1 (permalink)  
Old 11-19-08, 02:35 AM
ZYP ZYP is offline
Newbie Coder
 
Join Date: Nov 2008
Location: Chiang Mai
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Embed YouTube movie not load... in Popup window

I have problem with embed YouTube movie in asp.net popup window.
Here is front-end

HTML Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="preview-youtube-internal.aspx.cs"
    Inherits="products_preview_youtube_internal" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Majestec | Movie View</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Label ID="lblHTMLCode" runat="server"></asp:Label>
    </div>
    </form>
</body>
</html>
Here is code-behind
Code:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

public partial class products_preview_youtube_internal : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string ls_YouTubeID = Request.QueryString["YouTubeID"] == null ? "" : Request.QueryString["YouTubeID"];

            lblHTMLCode.Text = "<object width=425 height=350>" +
                    "<param name=movie value=http://www.youtube.com/v/" + ls_YouTubeID + "></param>" +
                    "<embed src=http://www.youtube.com/v/" + ls_YouTubeID + " type=application/x-shockwave-flash " +
                        "width=425 height=350></embed></object>";
        }
    }
}
Note this popup window work by get youtube id from query string.

Quote:
YouTube id I mean for example http://www.youtube.com/watch?v=xxxxxxxx and this xxxxxxxx is my YouTubeID
It works when test on my own computer. But whenever I upload to remote server it fails.

I just wonder ..why do anyone have any suggestion about handle embed YouTube?

Thanks in advance.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 11-19-08, 03:51 AM
Yeroon's Avatar
Yeroon Yeroon is offline
Code Master
 
Join Date: Aug 2007
Location: Netherlands, Nijmegen
Posts: 850
Thanks: 2
Thanked 20 Times in 20 Posts
Do you get any errors? Can you paste the error details here if you do? The way you embed it now seems just fine.
__________________
Feel free to thank people if they help you by clicking thanks at a post.
=================================
Make it idiot proof and someone will make a better idiot.
=================================
Realise the impotence of proof reading everything you publish
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 11-19-08, 04:00 AM
ZYP ZYP is offline
Newbie Coder
 
Join Date: Nov 2008
Location: Chiang Mai
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Well.. there's no error but in the embed flash said "movie not load...".
It should be some error but I cannot find one... so I need to know that if there's any conflict with asp.net and embed YouTube?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 11-19-08, 04:39 AM
Yeroon's Avatar
Yeroon Yeroon is offline
Code Master
 
Join Date: Aug 2007
Location: Netherlands, Nijmegen
Posts: 850
Thanks: 2
Thanked 20 Times in 20 Posts
Can you paste the html output on the client side? So the html output? Seems you might be missing a few quotes maybe?
__________________
Feel free to thank people if they help you by clicking thanks at a post.
=================================
Make it idiot proof and someone will make a better idiot.
=================================
Realise the impotence of proof reading everything you publish
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 11-24-08, 01:28 AM
ZYP ZYP is offline
Newbie Coder
 
Join Date: Nov 2008
Location: Chiang Mai
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Sorry for let you wait...
Here is the output HTML...

HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
	Majestec | Movie View
</title></head>
<body>
    <form name="form1" method="post" action="preview-youtube-internal.aspx?YouTubeID=jnj79LrT-8M" id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJODExMDE5NzY5D2QWAgIDD2QWAgIBDw8WAh4EVGV4dAXbATxvYmplY3Qgd2lkdGg9NDI1IGhlaWdodD0zNTA+PHBhcmFtIG5hbWU9bW92aWUgdmFsdWU9aHR0cDovL3d3dy55b3V0dWJlLmNvbS92L2puajc5THJULThNPjwvcGFyYW0+PGVtYmVkIHNyYz1odHRwOi8vd3d3LnlvdXR1YmUuY29tL3Yvam5qNzlMclQtOE0gdHlwZT1hcHBsaWNhdGlvbi94LXNob2Nrd2F2ZS1mbGFzaCB3aWR0aD00MjUgaGVpZ2h0PTM1MD48L2VtYmVkPjwvb2JqZWN0PmRkZAccoTAwRlzvIcps7adfHc3tqiCe" />
</div>

    <div>
        <span id="lblHTMLCode"><object width=425 height=350><param name=movie value=http://www.youtube.com/v/jnj79LrT-8M></param><embed src=http://www.youtube.com/v/jnj79LrT-8M type=application/x-shockwave-flash width=425 height=350></embed></object></span>

    </div>
    </form>
</body>
</html>
Moreover this seems to work just fine on my localhost.. but when I tested on remote host..(yes that mean I published it) .. So I don't know what difference between localhost and remote host that made this error occurred.

Thanks

Last edited by ZYP; 11-24-08 at 01:30 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 11-24-08, 07:07 AM
Yeroon's Avatar
Yeroon Yeroon is offline
Code Master
 
Join Date: Aug 2007
Location: Netherlands, Nijmegen
Posts: 850
Thanks: 2
Thanked 20 Times in 20 Posts
Well it seems to be working just fine for me too. Both on localhost and publish server. Is you host allowing embeded content/objects?

Can you try to change your code to this, so all quotes are in place:

Code:
lblHTMLCode.Text = "<object width='425' height='350'><param name='movie' value='http://www.youtube.com/v/" + ls_YouTubeID + "'></param><param name='wmode' value='transparent'></param><embed src='http://www.youtube.com/v/" + ls_YouTubeID + "' type='application/x-shockwave-flash' wmode='transparent' width='425' height='355'></embed></object>";
__________________
Feel free to thank people if they help you by clicking thanks at a post.
=================================
Make it idiot proof and someone will make a better idiot.
=================================
Realise the impotence of proof reading everything you publish
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #7 (permalink)  
Old 11-27-08, 01:48 AM
ZYP ZYP is offline
Newbie Coder
 
Join Date: Nov 2008
Location: Chiang Mai
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Trophee

Ah... at last , sorry for let you wait (again )

Truly I cannot figure out what is the problem anyway. I used your code and it works! I see you add some code into flash object but I don't believe these is the real problem and yes.. I do believe in something prevent movie to load maybe the server itself.

Thanks for your help I'm sure the code you gave me is the perfect one. Even if the problem comes again it will not be problem of the code and that's fine. Thanks again for save my soul
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #8 (permalink)  
Old 11-27-08, 05:57 AM
Yeroon's Avatar
Yeroon Yeroon is offline
Code Master
 
Join Date: Aug 2007
Location: Netherlands, Nijmegen
Posts: 850
Thanks: 2
Thanked 20 Times in 20 Posts
Hehehe ok. No problem. Must be the quotes then
__________________
Feel free to thank people if they help you by clicking thanks at a post.
=================================
Make it idiot proof and someone will make a better idiot.
=================================
Realise the impotence of proof reading everything you publish
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Replace Popup Window? aDcOoL Script Requests 2 03-04-06 05:48 PM
how do I update form, and hidden values in a form from a popup window? lordmerlin JavaScript 2 12-13-05 03:05 PM


All times are GMT -5. The time now is 01:28 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.