开发者

Embedding a browser in Swing in the hopes of using a VLC applet

My goal here is to be able to have a local webpage which I can embed in my GUI. That local page will be able to play a video using VLC. I'm pretty sure I need a plugin to play a video with VLC (other browsers do, right?) but I'm not sure if this is possible in Java.

Is there another way of embedding video into an HTML page and then displaying that using Swing? Is VLC the wrong way to go? I know this project might seem weird but I assure you t开发者_运维问答his is the way I want to do it.


If you're only trying to play video then there are other alternatives to video playback then trying to get a Browser to display properly in Java. Video and Browser's are the two hardest things to do in Swing still and there's no sense trying to tackle both if you only need one.

However, if you do need both then once you have the Browser working you can use Flash pretty easily at that point for a lot of video and audio playback.

I've used two separate solutions for embedding a web browser into a Swing application. The first is pretty simple, you can wrap a SWTBrowser into a java Swing Component. The only downside here is that you get whatever the native browser is on each platform. The second is there is a Swing XULRunner project out there. XULRunner is what Firefox is built upon. It's a bit hard to find the project but it lets you fully customize the browser and use the same one on each platform.


Some older answers:

  • Best Java/Swing browser component?
  • Is there a way to embed a browser in Java?

NOTE that the 2nd option here refers to JWebPane, a project that has pretty much died.

I guess what I'm saying is, the support for this, in Java, out of the box, has never really materialized. You can certainly try JWebPane since it sounds like you're rendering a very simple page, but it may or may not work very well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜