1 Reply Latest reply on Jun 12, 2011 7:17 PM by Mykola3296

    Dynamic plug-ins: How to dispatch MediaFactoryEvent.PLUGIN_LOAD after loading external swf

    ssebuser Level 1


      I'm creating a dynamic OSMF plugin. That plugin needs to load external SWF file before sending the PLUGIN_LOAD event to the player.


      How can I override the dispatch of the PLUGIN_LOAD event on my MyCustomPluginPluginInfo custom class ?


      If it's not possible, the solution is to create a new MediaElement within my MyCustomPluginPluginInfo:

      var mediaElement:MediaElement = mediaFactory.createMediaElement( new URLResource(null) ); //the resource is null at this point


      On the player side I add that line when the plugin is loaded successfully:

      //Add listener on Media Element creation
      mediaFactory.addEventListener(MediaFactoryEvent.MEDIA_ELEMENT_CREATE, onMediaElementCreate);


      Is it a god solution or not ?

      Is there another way to do that ?


      Thanks !