解决 Flash Builder 中冲突的包名称
我正在使用 Flash Builder 4,需要一个与提示点配合使用的 VideoDisplay 组件。 Flex 的 VideoDisplay 所基于的较新版本的 OSMF 类已经处理了这个问题。我的想法是推出我自己的 VideoDisplay 组件,而不是对现有组件进行猴子修补。为此,我创建了一个包含较新版本的 OSMF 类的项目,以及另一个项目,我将使用该项目构建新的 VideoDisplay,并使用单独的包名称。
问题是,由于 Flex 4.1 SDK 包含大多数 OSMF 类及其原始包名称,因此诸如 import org.osmf.media.MediaPlayer;
之类的语句引用了位于
C:\Program Files\Adobe\Adobe Flash 建设者 4\sdks\4.1.0\frameworks\projects
而不是新版本 OSMF 中的 MediaPlayer 类。
我尝试重命名 OSMF 项目中的包,以便其名称明确,但我从 IDE 中收到异常(在前提条件检查期间发生意外异常。有关更多详细信息,请参阅错误日志)。
SDK 是否总是(正确地?)在战斗中获胜?是否有某种(肮脏的?)方法可以强制项目更喜欢对 swc/项目的引用而不是同名的 SDK 类?
欢迎任何建议。
编辑:鉴于这些评论,我显然没有很好地解释我的问题。所以又来了。
Flex 使用 OSMF 平台的旧版本、功能较差的视频播放器。我需要使用包含对提示点的支持的新版本。我已经下载了较新的 OSMF 源代码,它位于自己的项目中。为了将来的可维护性,我宁愿不必重命名该项目中的包。
我将实现的 VideoPlayer 位于第二个项目中,该项目不重复 Flex SDK 或 OSMF 的包名称。冲突发生在 Flex SDK 和 OSMF 之间,而不是我要构建的类与 OSFM 或 SDK 之间。我的项目需要访问 OSMF 项目中的类,而不是 Flex SDK 中具有包/类名称的类。由于Flex SDK基于OSMF,Flex保留了包和命名空间标识完整,因此命名存在歧义。
I am using Flash Builder 4 and need a VideoDisplay component that works with Cue Points. The newer version of theOSMF classes that Flex's VideoDisplay are based on handles this already. The idea is to roll my own VideoDisplay component rather than monkey patch the existing one. To do this, I have created a project with the newer version of the OSMF classes, and another project with which I would build the new VideoDisplay, in a separate package name.
The issue is that since the Flex 4.1 SDK contains the majority of the OSMF classes with their original package names, a statement such as import org.osmf.media.MediaPlayer;
references the class located at
C:\Program Files\Adobe\Adobe Flash
Builder
4\sdks\4.1.0\frameworks\projects
and not the MediaPlayer class in the newer version of OSMF.
I've tried to rename the packages in the OSMF project so that it is distinctly named, but I get an exception from the IDE (an unexpected exception occurred during precondition checking. See the error log for more details).
Does the SDK always (rightfully?) win in a fight? Is there some (dirty?) way to force a project to prefer a reference to an swc/project over an identically named SDK class?
Any suggestions welcome.
Edit: Given the comments, I've apparently done a poor job of explaining my problem. So here it goes again.
Flex uses an older, less capable version of the OSMF platform for its VideoPlayer. I need to use the new version that includes support for cue points. I have downloaded the newer OSMF source and it is in its own project. I would prefer to NOT have to rename the packages in this project for the sake of future maintainability.
The VideoPlayer I will implement is in a second project that DOES NOT duplicate the package names of either the Flex SDK or OSMF. The conflict is between the Flex SDK and OSMF, not between the classes I would build and either OSFM or the SDK. My project needs to access classes in the OSMF project, not those from the Flex SDK that have the name package/class names. Because the Flex SDK is based on OSMF, Flex has left the package and namespace identifies intact, thus the naming ambiguity.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
何不把自己的视频组件放在自己独特的包下(反向域名)。在很多方面都会更好。它将区分您作为该包的作者并减少冲突。
Why don't you put your own video component under your own unique package (reverse domain name). It would be better in many ways. It will distinguish You as the author of that package as well as reduce conflicts.
从“Flex Build Path”中的 Flex 4.1 SDK 中删除 OSMF。
Remove OSMF from the Flex 4.1 SDK in "Flex Build Path".