1 Reply Latest reply on Oct 29, 2010 10:21 AM by bringrags

    Best way to pass data to a plugin

    Xavi Colomer

      Hello community,

       

      We're are trying to decouple the code from our player using plugins, until now we created a correct plugin structure, but the plugins itself were accessing to the Model, wich is tight coupled.

       

      mediaFactory.loadPlugin( new PluginInfoResource( new StatisticsPluginInfo() ) );

       

      I would like to pass the data to the plugin, wich is the best way?

       

      Thanks

        • 1. Re: Best way to pass data to a plugin
          bringrags Level 4

          I believe this is discussed in greater detail in the Plug-in Developer's guide (PDF), but the short answer is that you should use resource-level metadata to pass data from player to plug-in.  Your plug-in's documentation would explain what pieces of data you expect, and the player developer would be responsible for passing it in.  They can do so either on the PluginInfoResource (for "global" metadata, and which is passed to PluginInfo.initializePlugin), or on the resource that's passed to the MediaFactory (for resource-specific metadata, and which is passed to your MediaFactoryItem's canHandleResource method).