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
string html = "<html><head>"; html += "<meta content='IE=Edge' http-equiv='X-UA-Compatible'/>"; html += "<iframe id='video' src= 'https://www.youtube.com/embed/{0}' width='640' height='360' frameborder='0' allow = \"autoplay; encrypted-media\" allowFullScreen></iframe>"; html += "</body></html>"; this. webBrowser1.
WPF, or Windows Presentation Foundation, is a UI (user interface) framework that creates desktop client applications. The WPF development platform supports a broad set of application development features, including an application model, resources, controls, graphics, layout, data binding, documents, and security.
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 :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With