C#Java/YouTube帮助 [英] C# java/youtube help

查看:78
本文介绍了C#Java/YouTube帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,有人知道是否可以在C#Windows/Form应用程序中直接使用Java代码,以便我可以在表单上直接显示youtube视频,还可以将事件调用给无色youtube播放器吗?还是有其他方法可以在表单上显示无镶边YouTube播放器?

我的第一个想法是将一个ASP Web窗体应用程序加载到Web浏览器中,但这引起了2个问题:1,如果我尝试在Broser中运行ASP,我将看不到没有ASP服务器的Webbroser中的ASP站点. 2,我无法从Win表单中编辑Web表单(禁用按钮,单击表单按钮时调用事件等).

我尝试过的另一件事是Shockwave Flash Player,但是由于缺少事件等原因,这不是一个选择.

我也在使用google和youtube API,但它们似乎无法以Java和.net(asp)以外的任何其他方式显示或播放视频.

因此,我想要的是一种在win窗体中具有youtube控件(无镶边播放器)的方法,我可以在该窗体上调用事件并基本上修改所有内容,并且可以使用youtube和google api甚至java脚本,如果你们当中有人可以帮助我,我将非常感激. TY

-杰基

-
我的梦想可能是使它看起来像这样: http://code.google. com/intl/da-DK/apis/youtube/youtube_player_demo.html [ ^ ]刚刚以win形式显示,可以在视频等上调用事件.

Hi does any one know if it is posseble either to use java code directly in a C# windows/Form application so i can display a youtube video directly on the form and also call event to a chromeless youtube player? or is there an other way around to display a chromeless youtube player on a form?

my first idea was to load a asp webform application into a webbrowser but this gies 2 problems: 1, i cant see a asp site in a webbroser without a asp server witch wont show up if i try to run the asp in a broser. 2, i cant edit the webform from my win-form (disable buttons, call events on form button click etc.)

an other thing i''ve tried was the shockwave flash player but this is not an option due to lack of events and so on.

I am also using the google and youtube API but it seems they wont be able to show or play a video in anything else than java and .net (asp).

so what i want is a way to have a youtube control (chromeless player) in a win-form that i can call events on and modify basicly everything with my form, and the youtube and google api or even java script if this is possble, if any of you out there could help just some how i would be very thanksfull. TY

-Jackie

-
my dream could be to have it look abit like this: http://code.google.com/intl/da-DK/apis/youtube/youtube_player_demo.html[^] just displayed in a win-form with possability to call event on the video etc.

推荐答案

两种在WinForm中运行Java的解决方案
1.在带有隐藏主窗口的单独进程中运行Java控件,并将该控件的句柄传递给C#应用程序
2.您可以使用JNBridge;请参考 http://www.jnbridge.com/ [ ^ ]
Two solutions to run Java in your WinForm
1. Run your java control inside separate process with hidden main window and pass handle of that control to your C# application
2. You can use JNBridge; refer at http://www.jnbridge.com/[^]


我发现我可以制作一个HTML Java页面并将其加载到Web浏览器中进行控制,然后使用webbrowser.document.InvokeScript("scriptname"),在此之上,如何通过单击按钮等直接或多或少地执行我想要的所有操作.
它也可以与youtube java api一起很好地工作,所以到目前为止,这是我所做的,因为它既简单又简单,并且可以像我想要的那样很好地工作.
Hi i''ve found out that i can make a HTML java page and load it into a webbrowser control and then use webbrowser.document.InvokeScript("scriptname") and on that how do more or less everything i want directly from a button click and so on.
also it works fine with the youtube java api so this is what i''ve done so far since it is both easy and simple and work very well like i wanted.


这篇关于C#Java/YouTube帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆