Flex NetConnection NetStream

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在线文档
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值