Stanislav Stankov
Stanislav Stankov

Reputation: 135

Catch flashvars in custom plugin for OSMF

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?

Upvotes: 0

Views: 170

Answers (2)

user2342460
user2342460

Reputation: 114

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.

Upvotes: 0

Robert Stöttner
Robert Stöttner

Reputation: 23

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()

Upvotes: 0

Related Questions