码迷,mamicode.com
首页 > 其他好文 > 详细

FMS用AS来实现拉流

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

标签:art   cti   io   new   app   ar   

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来实现拉流

标签:art   cti   io   new   app   ar   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!