There are situations where it is necessary to call a server side method on FMS. Some CDNs, for example Limelight, used to or maybe still do require you to call the FCSubscribe method in order to request a live stream. This send a signals to the Edge server to pull the live stream from the Origin server if it is not already being delivered to that Edge. While this delivery method and stream setup routine is being phased out across most CDNs I thought it may be useful to post a (slightly hackish) workaround to make this setup work with the FLVPlayback component.
The problem with the FLVPlayback component is that there is no obvious, simple way to obtain a reference to the NetConnection Object it uses under the hood. Sure, the ncMgr.getNetConnection let's you grab it but only once the connection is established, and while you can implement a custom NCManager class, this is not trivial and after all a NetConnection is being maintained already by the component, so why reinvent the wheel?
The following code is clearly not something I am proud of, but it worked at the time when I needed it. It was used to get a live stream working with the FLVPlayback component streaming from Limelight about a year or two ago.
/* this is the hack: check once every frame if the NC has been defined inside the FLVPlayback component */
this.onEnterFrame = function()
if (player.ncMgr.getNetConnection() != undefined)
this.onEnterFrame = null;
var serverName:String = "server.llnwd.net";
var appName:String = "account_name/_definst_";
var streamName:String = "live";
var source_Str = "rtmp://" + serverName + "/" + appName + "/" + streamName;
// start up by setting the contentPath (now called source in newer versions of the component)
player.contentPath = source_Str;
nc = player.ncMgr.getNetConnection();
nc.onFCSubscribe = function(info:Object)
trace("onFCSubscribe: " + info.code);
if (info.code == "NetStream.Play.StreamNotFound")
// handle error, retry after a few secs or similar
else if (info.code == "NetStream.Play.Start")
// we're successfully subscribed
// handle error
// not used right now
nc.onFCUnsubscribe = function(info:Object)
trace("subscribing to " + name);
// can be used to unsubscribe from stream
// listen to player events and kill manual connection once we're streaming
Hopefully this is helpful to someone.