3 Replies Latest reply on Feb 12, 2010 12:12 PM by mlabriola


    mlabriola Level 4

      So, the PluginManager accepts a media factory. The comments and docs suggesst that this is so that you have a single media factory. The PluginManager stores that MediaFactory intance.  Then, inside of initPluginFactory, it creates a brand new MediaFactory, where it adds all of the MediaInfo instances from the plugin that you are registering.


      Subdequently, the initial mediafactory passed to the plugin manager does not have these media infos. Later, when you try to call createMediaElement on the initial factory, it doesn't know about any of the media elements registered via the pluginmanager.


      What am I missing here? I am either misunderstanding something about the use case for plugins or this seems wrong.



        • 1. Re: PluginManager/MediaFactory
          bringrags Level 4

          The PluginManager uses two MediaFactory objects, but the second one is an implementation detail.  (The implementation uses a MediaFactory internally to do the plugin loading, but that never surfaces to the client.)  Any time you load a plugin via the PluginManager API, the loaded MediaInfos should show up so that calls to createMediaElement do return the MediaElement from the loaded plugin.  If you're not seeing this behavior, let us know.

          • 2. Re: PluginManager/MediaFactory
            mlabriola Level 4

            It's possible I am doing something wrong, but here is the gist:


            Create a media factory

            Create a pluginmanager, passing the mediafactory to its constructor.


            Create a new pluginInfoResource( passing it a new instance of a PluginInfo extension of mine

            Inside of the constructor of that plugin info, I create an array of media infos and pass them upstream through the constructor


            Later I call the createMediaElement method of the mediaFactory mentioned above and pass it a resource.


            It fails, and if I debug it, the infos inside of the MediaFactory is empty.



            • 3. Re: PluginManager/MediaFactory
              mlabriola Level 4

              ah,  nevermind. it is because I had the MediaInfoType of Proxy set on the MediaInfo of the Plugin.