Flex NetConnection NetStream
2010年04月13日
NetConnection使用时注意指定客户端,有些服务器端会回调客户端的方法,如果不指定会找不到,如:FMS,客户端都可以指定为this
NetStream也需要指定回调的客户端,这时候必须要实现一些回调方法,如onMetaData等,可以单独写一个客户端指定给NetStream的client
在这里除了回调默认的方法外,如果在FMS服务器端额main.asc文件里面还写了额外的需要回调的方法,也需要在这里写对应的方法
RIA时应该也需要这样
netConn=new NetConnection();
netConn.addEventListener(NetStatusEvent.NET_STATUS, netStatHandler);
netConn.connect(appServer);
netConn.client=this;
responder=new Responder(communicateHandler);
netConn.call("communicateServer",responder,loginUser.userid,callUser.userid,type);//呼叫fms服务器端的方法,方法接收呼叫者和被呼叫者的ID作为参数,同时通知被呼叫者
custClient=new CustomClient();
netStream=new NetStream(netConn);
netStream.client=custClient;//在live的时候不需要指定client,但是在播放服务器视频文件的时候,需要用到client来接收一些服务器端的状态
netStream.bufferTime=10;
netStream.soundTransform=new SoundTransform(0.5);
volChangeHandler(vol3);
netStream.play(tubefile.videosavename);
FLV Specify the stream name as a string, without a filename extension. s.play("fileName")
MP3 Specify the stream name as a string, with prefix mp3: or id3: , s.play("mp3:fileName")
respectively, and without a filename extension. s.play("id3:fileName")
MPEG-4-based files Specify the stream name as a string with the prefix mp4: . s.play("mp4:fileName")
(such as F4V, MP4) Use a file extension if the file on the server has a file extension. s.play("mp4:fileName.mp4")
The prefix indicates to the server that the file is in the MPEG-4 s.play("mp4:fileName.f4v")
Part 12 container format.
http://www.cnblogs.com/aierong/archive/2008/12/30/Flex.html#sp 这里很多关于FMS的文章,收藏一下
http://help.adobe.com/en_US/FlashMediaServer/3.5_SS_ASD/WS5b3ccc516d4fbf351e63e3d11a11aff5ba-7f8b.html FMS在线文档
2010年04月13日
NetConnection使用时注意指定客户端,有些服务器端会回调客户端的方法,如果不指定会找不到,如:FMS,客户端都可以指定为this
NetStream也需要指定回调的客户端,这时候必须要实现一些回调方法,如onMetaData等,可以单独写一个客户端指定给NetStream的client
在这里除了回调默认的方法外,如果在FMS服务器端额main.asc文件里面还写了额外的需要回调的方法,也需要在这里写对应的方法
RIA时应该也需要这样
netConn=new NetConnection();
netConn.addEventListener(NetStatusEvent.NET_STATUS, netStatHandler);
netConn.connect(appServer);
netConn.client=this;
responder=new Responder(communicateHandler);
netConn.call("communicateServer",responder,loginUser.userid,callUser.userid,type);//呼叫fms服务器端的方法,方法接收呼叫者和被呼叫者的ID作为参数,同时通知被呼叫者
custClient=new CustomClient();
netStream=new NetStream(netConn);
netStream.client=custClient;//在live的时候不需要指定client,但是在播放服务器视频文件的时候,需要用到client来接收一些服务器端的状态
netStream.bufferTime=10;
netStream.soundTransform=new SoundTransform(0.5);
volChangeHandler(vol3);
netStream.play(tubefile.videosavename);
FLV Specify the stream name as a string, without a filename extension. s.play("fileName")
MP3 Specify the stream name as a string, with prefix mp3: or id3: , s.play("mp3:fileName")
respectively, and without a filename extension. s.play("id3:fileName")
MPEG-4-based files Specify the stream name as a string with the prefix mp4: . s.play("mp4:fileName")
(such as F4V, MP4) Use a file extension if the file on the server has a file extension. s.play("mp4:fileName.mp4")
The prefix indicates to the server that the file is in the MPEG-4 s.play("mp4:fileName.f4v")
Part 12 container format.
http://www.cnblogs.com/aierong/archive/2008/12/30/Flex.html#sp 这里很多关于FMS的文章,收藏一下
http://help.adobe.com/en_US/FlashMediaServer/3.5_SS_ASD/WS5b3ccc516d4fbf351e63e3d11a11aff5ba-7f8b.html FMS在线文档