0

I'm creating a custom plugin for OSMF, and trying to set it to work in Strobe Media Player set up example: http://projects.stanislavstankov.com/nsa/index2.html

var parameters = {
                src: "nsa",
                autoPlay: "false",
                verbose: true,
                controlBarAutoHide: "false",
                controlBarPosition: "bottom",
                plugin_nsaPlugin: "nsaPlugin.swf", 
                nsaPlugin_streamType: "vod",
                nsaPlugin_streamName: "vod",
                nsaPlugin_mediaID: "nsa-zGAet1-e1",
                nsaPlugin_deliveryType: "rtmp"
};

I want to be able to get them but I cannot find any documentation how. I try to catch them as:

stage.loaderInfo.parameters

but stage returns null. Can someone help me?

2 Answers2

0

You can try to add a listener for the AddedToStage-Event inside flash:

addEventListener(Event.ADDED_TO_STAGE, onAddedToStage, false, 0, true);

private function onAddedToStage(e:Event):void {
// stage != null from now on ...
}

make sure you add the clip with this listener to the displaylist, .. using addChild()

  • The idea is that I'm using OSMF framework. I think there is a way to be received, not to wait your plugin to be added to stage and then to be able to them them. Are you sure there is no other way? – Stanislav Stankov Mar 19 '14 at 15:08
  • I could not find any information about how to access flash vars inside a plugin of the OSMF framework. The only solution I know is using the loaderInfo-object ... documentation: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/LoaderInfo.html – Robert Stöttner Mar 20 '14 at 11:54
  • Hi Robert, I manage to find it out :) I will post here my solution in case other people wonder about it also. You can see it on: http://showcase.stanislavstankov.com/2014/03/catch-custom-osmf-plugin-flashvars/ – Stanislav Stankov Mar 25 '14 at 13:54
0

There are some vars that you might find difficult to get like autoPlay. You are better off sending these vars to your plugin like this:

var parameters = {
                src: "nsa",
                autoPlay: "false",
                verbose: true,
                plugin_nsaPlugin: "nsaPlugin.swf", 
                nsaPlugin_autoPlay: "false",
};

Your plugin needs to extend the PluginInfo class if you want to be able to read out the variables that you send to your plugin. You read them out from the MediaResource that gets sent to the initializePlugin method upon intialization of your plugin. Here is an example.

user2342460
  • 114
  • 4