Gili
Gili

Reputation: 90043

Embedding Flash Player in a C++ or Java application?

I would like to embed Flash Player directly inside a C++ or Java application.

I found an article that describes how to do this for C#: http://www.adobe.com/devnet/flash/articles/stock_history03.html

Unfortunately, I have no experience with C#, COM or ActiveX. I need someone to translate this code to C++, allowing me to embed the Flash Player into a Win32 Window. Ultimately I'd like to use this information to embed Flash into a Java application.

I am looking for three main functionalities:

  1. Ability to play a Flash movie
  2. Ability to receive events (such as mouse clicks)
  3. Ability to send events

Edit: I prefer an open-source solution if possible.

Upvotes: 8

Views: 13395

Answers (8)

Daniel Spiewak
Daniel Spiewak

Reputation: 55123

I don't know how to embed flash in C++, but Christopher Deckers (of SWTSwing fame) has developed an interesting hack which allows it to be embedded in Java. You can find more information in the Javalobby announcement thread.

Here is an updated link: https://github.com/Chrriis/DJ-Native-Swing

Upvotes: 6

Alex
Alex

Reputation: 363

Take a look at FlashDX. It is open-source and free.

Upvotes: 0

Eximius
Eximius

Reputation: 307

What you should use is Netscape Plugin API. It's native and it's what all the good browsers use to load flash player plugin. While the actual flash player is not open source, this API is.

If you're not gonna ship a copy of flashplayer with your app:

Your app should check at runtime for flash player and should alert the user if it doesn't find it (usually by giving a link to Adobe to download it). Flashplayer plugin is usually installed at %AppData%\Mozilla\plugins on Windows.

Upvotes: 0

tstenner
tstenner

Reputation: 10291

If it has to be open source I'd consider Gnash, an open source flash implementation.
It works on all major platforms, supports most multimedia codecs and is supposed to be embeddable in applications through nsapi.

Upvotes: 1

Vano512
Vano512

Reputation:

I personally haven't tried this but say in case of SWT/Java you could embed SWT browser window in you SWT/Java application and in the browser view you could put content with flash content, then communicate say with Merapi bridge with flash movie and java.

Upvotes: -1

Heng-Cheong Leong
Heng-Cheong Leong

Reputation: 864

One simple way to create a Flash player in your window: AtlAxCreateControlEx.

To receive and send events, you will need a sink: AtlAdvise. You will need to define the functions receiving events on the ActionScript (i.e. Flash) side too.

Upvotes: 0

Adam Rosenfield
Adam Rosenfield

Reputation: 400344

If you want to go with a commercial solution, I'd recommend Scaleform GFx. It's not cheap, though, but it's damn good.

Upvotes: 0

Related Questions