Vero009
Vero009

Reputation: 622

How to play a YouTube video in WPF using C#

I want to play a YouTube video in my WPF application. I am using Google API and successfully get information about video but i don`t understand how to play a video. Here is my code which is i used for retrieve 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

Upvotes: 7

Views: 14580

Answers (1)

EKS
EKS

Reputation: 5623

You'll have to use a WebBrowser control - Here's an example: http://www.codeproject.com/Articles/27121/Stream-YouTube-Videos-in-WPF

Cut and past of what Mike posted as comment :)

Upvotes: 10

Related Questions