How to play YouTube video in WPF using C #

I want to play a YouTube video in my WPF application. I use the Google API and get information about the video successfully, but I don’t understand how to play the video. Here is my code that I used to get the information.

  YouTubeRequestSettings setting = new YouTubeRequestSettings("MyAPP", "ID");
  YouTubeRequest request = new YouTubeRequest(setting);
  YouTubeQuery myQuery = new YouTubeQuery(YouTubeQuery.MostPopular);
  myQuery.OrderBy = "viewCount";
  Feed<Video> videoFeed = request.Get<Video>(myQuery);
  foreach (Video item in videoFeed.Entries)
       {
          listBox1.Items.Add(item.Title);
       }

thank`s

+5
source share
1 answer

You will need to use the WebBrowser control. Here is an example: http://www.codeproject.com/Articles/27121/Stream-YouTube-Videos-in-WPF

The abbreviation and past of what Mike wrote as a comment :)

+8
source

All Articles