C# 在 C++ 或 Java 应用程序中嵌入 Flash Player?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/214411/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-03 18:25:39  来源:igfitidea点击:

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

c#javac++flash

提问by Gili

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

我想直接在 C++ 或 Java 应用程序中嵌入 Flash Player。

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

我找到了一篇描述如何为 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.

不幸的是,我没有使用 C#、COM 或 ActiveX 的经验。我需要有人将此代码转换为 C++,以便我将 Flash Player 嵌入到 Win32 窗口中。最后,我想使用这些信息将 Flash 嵌入到 Java 应用程序中。

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
  1. 能够播放 Flash 电影
  2. 能够接收事件(例如鼠标点击)
  3. 发送事件的能力

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

编辑:如果可能,我更喜欢开源解决方案。

采纳答案by Daniel Spiewak

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

我不知道如何在 C++ 中嵌入 flash,但 Christopher Deckers(SWTSwing成名)开发了一个有趣的 hack,可以将它嵌入到 Java 中。您可以在Javalobby 公告线程中找到更多信息。

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

这是一个更新的链接:https: //github.com/Chrriis/DJ-Native-Swing

回答by Adam Rosenfield

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

如果您想使用商业解决方案,我会推荐Scaleform GFx。虽然它并不便宜,但它非常好。

回答by Heng-Cheong Leong

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

在窗口中创建 Flash 播放器的一种简单方法: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.

要接收和发送事件,您需要一个接收器:AtlAdvise。您还需要在 ActionScript(即 Flash)端定义接收事件的函数。

回答by Heng-Cheong Leong

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.

我个人还没有尝试过这个,但说在 SWT/Java 的情况下,你可以在你的 SWT/Java 应用程序中嵌入 SWT 浏览器窗口,在浏览器视图中你可以放置带有 Flash 内容的内容,然后与带有 Flash 电影的 Merapi 桥进行通信和爪哇。

回答by tstenner

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.

如果它必须是开源的,我会考虑Gnash,一个开源的闪存实现。
它适用于所有主要平台,支持大多数多媒体编解码器,并且应该可以通过nsapi嵌入到应用程序中。

回答by Eximius

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.

您应该使用的是Netscape Plugin API。它是原生的,所有优秀的浏览器都用它来加载 Flash 播放器插件。虽然实际的 Flash 播放器不是开源的,但这个 API 是。

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

如果您不打算随应用程序一起提供 flashplayer 的副本:

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\pluginson Windows.

您的应用程序应在运行时检查 Flash 播放器,并在未找到时提醒用户(通常通过提供指向 Adob​​e 的下载链接)。Flashplayer 插件通常安装在%AppData%\Mozilla\pluginsWindows 上。

回答by Alex

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

看看FlashDX。它是开源和免费的。