5 Replies Latest reply on Aug 16, 2012 1:09 AM by Ankit Tanna

    load Akamai plugin example using Static plugin loading method

    lllgy

      Hi,
      I want to load Akamai plugin example using Static plugin loading method. For that, I passed "com.akamai.osmf.AkamaiBasicStreamingPluginInfo" as a class defination, but I got error stating, ReferenceError: Error #1065: Variable AkamaiBasicStreamingPluginInfo is not defined.

       

      Makjosh once sent a post that the title was "Getting an error while loading the plugin using static plugin load method". I then follow the solution. But how can I add the dependent project(Flex/AS Build Path -> Library Path -> Add Project). As a result, I do not find the AkamaiBasicStreamingPlugin project only having the NetMocker project and the StrobeUnit project in it.

       

      So I try to link the AkamaiBasicStreamingPlugin project use the following method(project properties->Project References->select "AkamaiBasicStreamingPlugin"), it still causes the same error.

       

      Please help me.

       

      Thanks.

        • 1. Re: load Akamai plugin example using Static plugin loading method
          charles_newman-6QjwQx

          Hi,

           

          A couple of things to look at:

           

          1) Make sure you have the import statement in your project:

                      import com.akamai.osmf.AkamaiBasicStreamingPluginInfo;
          2) Make sure you add the AkamaiBasicStreamingPlugin folder to your Flex Build Path (right click project, select "properties", then "Flex Build Path", in "Source Path" you need to add the plugin folder).

          3) If you are still getting Error #1065, you can try a trick where you force the swf compiler to pull in the class:

                      private static const loadTestRef:AkamaiBasicStreamingPluginInfo = null;

           

          Now you should be able to use getDefinitionByName to load the plugin:

                          var pluginResource:IMediaResource;

                          var pluginInfoRef:Class = flash.utils.getDefinitionByName(className) as Class;

           

                          pluginResource = new PluginClassResource(pluginInfoRef);

           

                          pluginManager.addEventListener(PluginLoadEvent.PLUGIN_LOADED, onPluginLoaded);
                          pluginManager.addEventListener(PluginLoadEvent.PLUGIN_LOAD_FAILED, onPluginLoadFailed);
                          pluginManager.loadPlugin(pluginResource);

           

           

           

           

          Hope that helps,

          - charles

          • 2. Re: load Akamai plugin example using Static plugin loading method
            lllgy Level 1

            Hi charles,

             

            I have added  the AkamaiBasicStreamingPlugin folder to my Flex Build Path (right click project, select "properties", then "Flex Build Path", in "Source Path" you need to add the plugin folder). I also added "import com.akamai.osmf.AkamaiBasicStreamingPluginInfo" in my project. But the main error is from "1172: not defined com.akamai.osmf:AkamaiBasicStreamingPluginInfo".

             

            Can you give some advises?

             

            Thank.

            • 3. Re: load Akamai plugin example using Static plugin loading method
              charles_newman-6QjwQx Level 1

              Hi,

               

              Can you take a look at the AkamaiPluginSample Flex project and see if that works for you?  It loads the Akamai plugin dynamically or statically.

               

              Thanks,

              - charles

              • 4. Re: load Akamai plugin example using Static plugin loading method
                dwischusen Level 1

                Hi IIIgy,

                 

                Looking at your post it looks like you missed the most important step that Charles mentioned.  You have to force the compiler to include the class that you are looking to load dynamically at runtime.  The import statement alone will nott do it.  You have to reference the class somewhere in your code.

                 

                e.g.,

                 

                private var akamaiClass: AkamaiBasicStreamingPluginInfo;

                 

                Best,

                Derek

                • 5. Re: load Akamai plugin example using Static plugin loading method
                  Ankit Tanna Level 1

                  Hi Charles,

                   

                  Do we need to do the same for the MAST Plugins in Strobe Media Player?

                   

                  Eager to get your response.

                   

                  Thanks.