0

I'm trying to embed a youtube video in a winforms application.

When I click I button, a new panel pops up with the video in it and it should play.

However, it doesn't. There's just a black box and nothing happens. Here's what the code looks like for that button:

private void module1_summary_nextpic_Click(object sender, EventArgs e)
        {
            activePanel.Visible = false;
            activePanel = module1_content;
            module1_content.Size = module1_panel.Size;

            activePanel.Visible = true;
            doc1.LoadMovie(0, "http://youtu.be/2Vb8dg_un-A");
            doc1.Play();
        }

any ideas as to why it's not showing/playing? i'm using vs2012.

edit: i've tried this solution here: https://stackoverflow.com/questions/17666243/calling-play-on-c-sharp-shockwave-component-doesnt-start-youtube-video-playba?rq=1 with no avail.

Community
  • 1
  • 1
Ted
  • 487
  • 2
  • 12
  • 23

1 Answers1

1

There is a problem with your link. Link should be like this:

http://www.youtube.com/v/2Vb8dg_un-A

That will make youtube video embbeded. Also, if you want to make it to autoplay just add &autoplay=1 at the end of the link.