如何使用C#WPF中播放YouTube视频 [英] How to play a YouTube video in WPF using C#
本文介绍了如何使用C#WPF中播放YouTube视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在我的WPF应用程序播放YouTube视频。我使用谷歌的API,并成功获得有关视频资料,但我不`吨了解如何播放视频。这是我的code这是我用来检索信息。
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
thank`s
推荐答案
您将不得不使用WebBrowser控件 - 这里有一个例子: HTTP://www.$c$cproject.com/Articles/27121/Stream-YouTube-Videos-in-WPF
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 :)
这篇关于如何使用C#WPF中播放YouTube视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文