FMS Administration api help
my application name is : liveVideo
livefeed name is: livefeedLive
Sorry don't have much time to write detailed code, but following is bare minimum which i think should work for you, you can modify and add detail later and customize it to suit your need:
import flash.net.NetConnection;
import flash.net.NetStream;
import flash.events.*;
import flash.system.Capabilities;
var nc:NetConnection;
var resp1:Responder;
var resp2:Responder;
function onCallSuccess(resObj):void{
for(var i in resObj){
trace("NetStream Top Level data:"+i);
trace("NetStream Top Level value:"+resObj);
if( i.toString() == "data"){
for(var j in resObj){
trace("NetStream Low Level Data:"+j);
trace("NetStream Low Level Value:"+resObj
if(resObj
nc.call("getNetStreamStats",resp2,"live/_definst_",resObj
}
}
}
}
}
function onCallSuccess2(resObj):void{
//write similar code as onCallSuccess as per your req
for(var m in resObj){
trace("NetStreamStats Top Level Data:"+resObj
for(var n in resObj
for(var o in resObj
trace("NetStreamStats Low Level Data:"+resObj
}
}
}
}
nc = new NetConnection();
resp1 = new Responder(onCallSuccess,null);
resp2 = new Responder(onCallSuccess2,null);
nc.addEventListener(NetStatusEvent.NET_STATUS, script_ncStatus);
function script_ncStatus(event:NetStatusEvent):void{
var info:Object = event.info;
if(info.code=="NetConnection.Connect.Success"){
nc.call("getNetStreams",resp1,"live/_definst_");
}
}
nc.connect("rtmp://<server-ip>/admin","admin","admin");
There are lot other codes which you can use to get other statistics in above fashion , like getLiveStreams,getLiveStreamStats - please refer Admin API guide which comes with FMS installation.
Hope it works for you. ![]()
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.