0

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.

Laramie
  • 5,457
  • 2
  • 39
  • 46
  • If you give your own classes the same package and names as the OSMF classes, then your custom classes should take precedence in your project. I'm surprised you say they aren't. – JeffryHouser Dec 20 '10 at 13:52

2 Answers2

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.

  • Exactly what I was attempting. The problem is that unless I want to re-create the entire OSMF library, I need to reference it instead of the OSMF classes in the SDK. The video component that references OSMF would be in a separate package. The conflict is between the newer version of OSMF and the older version used by the Flex SDK. They are 80% equal. – Laramie Dec 20 '10 at 09:28
  • +1 @Laramie Based on your question text, you are attempting the exact opposite that this answer recommends. It sounds like you are trying to name your own classes the exact name/package as the framework classes. Renaming OSMF packages in the Framework SWC is not something I'd attempt. – JeffryHouser Dec 20 '10 at 13:51
  • I mentioned "reference it", not "duplicate it". I've tried to explain more clearly in my original question. Thanks for the feedback though. – Laramie Dec 20 '10 at 18:54
1

Remove OSMF from the Flex 4.1 SDK in "Flex Build Path".

Laramie
  • 5,457
  • 2
  • 39
  • 46
  • actually I have the exact same problem, but when I remove OSMF from the Flex Build Path, no matter what I add as osmf.swc replacements, the project will not compile (throws an error before compiling, with no info) – Cystack Aug 10 '11 at 19:24