9 Replies Latest reply on Sep 17, 2010 3:03 PM by netsql444

    Troubles with OSMF.SWC 1.0 in Flex 4 (Flash Builder 4) project

    jokeane

      I've tried following the directions on using OSMF.SWC in Flash  Builder 4 w/ Flex 4, but I've run into some problems. I was able to get  it to work with simple projects like ExamplePlayer and a HelloWorld  style project, but when I tried to hook OSMF.SWC into my existing project I ran into trouble.

       

      If I remove the osmf.swc reference in the Flex  Library Build Path and add a copy of OSMF.swc from the 1.0 distribution,  I get compile errors which indicate that something is still expecting  to use the older version of OSMF.

       

      "1046: Type was not found or was not a  compile-time constant: DimensionEvent.    Inspire.FlexCommon         Unknown    Flex Problem"

       

      My project uses a common SWC for the majority of  the code. I then link this library into two different projects, one Flex  and one AIR (so I can build an in browser and a desktop version of the  app).

       

      In  the common SWC I was using the Flex 4 VideoPlayer. Initially I thought  this was the problem, but even after I removed references to  VideoPlayer, I still was getting some errors. At one point, I did get things to build, but then got a runtime error related to the preloader.

       

      Since the existing code  in Flex 4 is designed to work with the earlier version of OSMF, is it  even possible to get things working correctly in this case?

       

      Is there a  new version of the Flex 4 distribution which references the OSMF 1.0? If  so where?

       

      Should  I just give up and try to work with whatever version of OSMF was  shipping in Flash Builder 4 / Flex 4.0?

       

      Runtime error:

      VerifyError: Error #1053: Illegal override of processContextChange in org.osmf.layout.DefaultLayoutRenderer.

       

          at flash.display::MovieClip/nextFrame()
          at mx.managers::SystemManager/deferredNextFrame()[E:\dev\4.0.0\frameworks\projects\framework \src\mx\managers\SystemManager.as:267]
          at mx.managers::SystemManager/preloader_preloaderDocFrameReadyHandler()[E:\dev\4.0.0\framewo rks\projects\framework\src\mx\managers\SystemManager.as:2460]
          at flash.events::EventDispatcher/dispatchEventFunction()
          at flash.events::EventDispatcher/dispatchEvent()
          at mx.preloaders::Preloader/timerHandler()[E:\dev\4.0.0\frameworks\projects\framework\src\mx \preloaders\Preloader.as:488]
          at flash.utils::Timer/_timerDispatch()
          at flash.utils::Timer/tick()

        • 1. Re: Troubles with OSMF.SWC 1.0 in Flex 4 (Flash Builder 4) project
          bringrags Level 4

          We do indeed recommend replacing the osmf.swc from a Flex 4 project if you're going to use OSMF in Flex 4, but you may (will?) run into issues if you attempt to use Flex's VideoPlayer within that project.  Note also that you'll need to replace osmf.swc for each individual project (or edit your flex-config.xml file to point to the updated SWC).

           

          In terms of future plans, we are working closely with the Flex team to ensure that their next release ships with the latest OSMF version.  No ETA on that though.

          • 2. Re: Troubles with OSMF.SWC 1.0 in Flex 4 (Flash Builder 4) project
            FTQuest Level 3

            bringrags wrote:

             

            We do indeed recommend replacing the osmf.swc from a Flex 4 project if you're going to use OSMF in Flex 4, but you may (will?) run into issues if you attempt to use Flex's VideoPlayer within that project.  Note also that you'll need to replace osmf.swc for each individual project (or edit your flex-config.xml file to point to the updated SWC).

             

            In terms of future plans, we are working closely with the Flex team to ensure that their next release ships with the latest OSMF version.  No ETA on that though.

             

            I have followed the recommendations and removed the old version of swc and replaced it with the release version. And so far the video and audio players work fine without errors.

            But looking at the flex-config.xml I see that it still points to the old version.

             

            <!-- OSMF SWC -->

                <runtime-shared-library-path>

            <path-element>libs/osmf.swc</path-element>

            <rsl-url>http://fpdownload.adobe.com/pub/swz/flex/4.0.0.14159/osmf_flex.4.0.0.13495.swz</rsl-url>

            <policy-file-url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</policy-file-url>

            <rsl-url>osmf_flex.4.0.0.13495.swz</rsl-url>

            <policy-file-url></policy-file-url>

            </runtime-shared-library-path>

             

            Could you elaborate a little bit more on editing this part of flex-config.xml?

             

            Thanks,

            FTQuest

            • 3. Re: Troubles with OSMF.SWC 1.0 in Flex 4 (Flash Builder 4) project
              bringrags Level 4

              The flex-config.xml file is what Flex Builder uses to set up project settings for newly created projects.  So to override the defaults, you can either manually set these properties in the Project Properties dialog for each new project you create, or you can change them in the flex-config.xml file so that they automatically take effect for any new project you create.

              • 4. Re: Troubles with OSMF.SWC 1.0 in Flex 4 (Flash Builder 4) project
                jokeane Level 1

                I've tried just pulling the references to VideoPlayer, VideoDisplay out of my app, and then pulling the original OSMF.SWC from the Flex Library Build Path (in all projects). This is in preperation to adding in the 1.0 OSMF.SWC.

                 

                What I've found is that the common library SWC compiles, the Flex project compiles and runs, but the AIR project does not - errors below.

                 

                The AIR project is making use of the auto-update feature in AIR... could that be the issue?

                 

                Description    Resource    Path    Location    Type
                1046: Type was not found or was not a compile-time constant: AudioEvent.    Inspire.AIR        Unknown    Flex Problem
                1046: Type was not found or was not a compile-time constant: AudioEvent.    Inspire.AIR        Unknown    Flex Problem
                1046: Type was not found or was not a compile-time constant: DimensionEvent.    Inspire.AIR        Unknown    Flex Problem
                1046: Type was not found or was not a compile-time constant: MediaPlayerStateChangeEvent.    Inspire.AIR        Unknown    Flex Problem
                1046: Type was not found or was not a compile-time constant: MediaPlayerStateChangeEvent.    Inspire.AIR        Unknown    Flex Problem
                1046: Type was not found or was not a compile-time constant: SeekEvent.    Inspire.AIR        Unknown    Flex Problem

                 

                As I've alluded to previously, this is currently stalling my project.

                 

                What is the proper way to integrate OSMF 1.0 into a 'real' (rather than a toy) project? It seems if there are many references in Flex 4.0 to OSMF v0.9, the only way to fix this is by patching up Flex 4.0... is this being worked on by the Flex team? By the OSMF team? No one?

                • 5. Re: Troubles with OSMF.SWC 1.0 in Flex 4 (Flash Builder 4) project
                  bringrags Level 4

                  Based on the error messages, it looks like your application is still linking in an older version of OSMF.  I just created an AIR project in Flash Builder 4, replacing the osmf.swc with the latest one, and got the same error when I used VideoDisplay.  However, I didn't get the error when I removed VideoDisplay and use the OSMF classes (e.g. MediaPlayer and VideoElement) directly.  Is it possible you're using a class that has a reference to VideoDisplay or VideoPlayer?  You might want to try isolating parts of your app to see what the culprit is.

                   

                  In terms of the OSMF/Flex integration, we're working with the Flex team to ensure that their next release has a more recent version of OSMF.  Given the differences in release schedule though, it will often be the case that Flex won't have the most recent version of OSMF.  In such cases, the workaround of removing the old osmf.swc and replacing with a newer one is the best available option (though admittedly it limits your usage of the Flex controls that use OSMF).  Note also that the errors you get when switching OSMF SWCs in Flex will be considerably reduced, if not eliminated, in the next release of the Flex SDK, given that the current errors are the result of OSMF API changes that happened in the pre-1.0 development time frame.

                  • 6. Re: Troubles with OSMF.SWC 1.0 in Flex 4 (Flash Builder 4) project
                    jokeane Level 1

                    Does your AIR app auto-update itself?


                    • 7. Re: Troubles with OSMF.SWC 1.0 in Flex 4 (Flash Builder 4) project
                      bringrags Level 4

                      Not that I know of -- is that a setting in the app XML file?  Can you try without auto-update enabled?  In any case, I doubt that an AIR update would impact the client code or SDK, I would think that it would only update the AIR runtime.

                      • 8. Re: Troubles with OSMF.SWC 1.0 in Flex 4 (Flash Builder 4) project
                        JT Newbie

                        Was having this problem trying to compile the helloworld.as examples in the flex SDK; so I changed the target player to 10.1 from 10.0 and it seemed to fix it.

                         

                        --------------

                        <!--
                           <target-player>10.0.0</target-player>
                        -->
                           <target-player>10.1.0</target-player>

                        ---------------------

                        • 9. Re: Troubles with OSMF.SWC 1.0 in Flex 4 (Flash Builder 4) project
                          netsql444

                          Can this "all" be done in ANT build file? If your not using FlashBuilder.

                           

                          Just a build file that reliably builds an OSMF project. Ex via external-library-path that would exclude the SDK osmf.swc and use the osmf.swc in your proejct's libs.

                          Is that the right build flag?

                           

                          tia,

                          .V