首页 > 其他 > 详细

FMS用AS来实现拉流

时间:2014-07-01 18:27:04      阅读:335      评论:0      收藏:0      [点我收藏+]

application.onAppStart=function ()
{
  this.myNC=new NetConnection();
  this.myNC.onStatus=NC_onStatus;
  this.myNC.onBWDone=NC_onBWDone;
  this.myNC.connect("rtmp://192.168.0.86/tsubasa");
  trace("Start");
};


function NC_onStatus(info)
{
  switch(info.code)
  {
  case "NetConnection.Connect.Success":
  application.myStream=Stream.get("stream");
  application.myStream.onStatus=NS_onStatus;
  if(application.myStream)
  {
    application.myStream.play("stream",-2, -1,false,application.myNC);
    trace("myStream=>play");
  }
  trace("连接成功!");
  break;
  case "NetConnection.Connect.Failed":
  trace("连接失败!");
  break;
  case "NetConnection.Connect.Rejected":
  trace("连接被拒绝!");
  break;
  default:
  trace("连接信息 "+info.code);
  break;
  }
}


function NS_onStatus(info)
{
  trace("视频流 "+info.code);
}
function NC_onBWDone(obj)
{
  trace("NC_onBWDone");
}

FMS用AS来实现拉流,布布扣,bubuko.com

FMS用AS来实现拉流

原文:http://www.cnblogs.com/fuland/p/3817819.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!