Feb 22
客户端预先定义say_Result响应函数,然后调用由Flash Media Server提供给客户端的say方法。而Flash Media Server为客户端定义的say函数实际上是在处理amfphp提供的服务——phpSay,再由其回调HelloWorld类的phpSay_Result方法,进而触发了客户端预定义的say_Result函数。
客户端:
var _nc = new NetConnection();
_nc.say_Result = trace;
_nc.connect(’rtmp://x/helloworld’);
_nc.call(’say’, null, ‘hello world!’);
Continue reading »
May 21
function recFLV(){
var ns:NetStream = new NetStream(nc);
var cam:Camera = Camera.getCamera();
ns.attachCamera(cam);
ns.publish (”name”,”record”);
}
这样的代码,不会在fms服务器上产生flv流.
而改成如下便可以.
var ns:NetStream;
function recFLV(){
ns= new NetStream(nc);
var cam:Camera = Camera.getCamera();
ns.attachCamera(cam);
ns.publish (”name”,”record”);
}
原因是第一种写法中,NetStream对象是函数局部的,只要执行完recFLV函数最后一句话后,这个实例就会被清空,就没有连接了.