我正在使用 Adobe Air 13.0 将流式视频上传到 Flash Media Server。这适用于所有 Android 设备,但在 iOS 设备(iPad 和 iPhone)上,发布流会在几次(可能是 10 秒,可能是 5 分钟)后中断。
这是我的相关代码段:
private function CreateConnection():void
{
netconn = new NetConnection();
netconn.client = this;
netconn.objectEncoding = flash.net.ObjectEncoding.AMF3;
netconn.connect(rtmpPath);
netconn.addEventListener("netStatus", netConnection_eventHandler);
}
...
netStream = new NetStream(netconn, NetStream.CONNECT_TO_FMS);
netStream.client=this;
netStream.addEventListener(NetStatusEvent.NET_STATUS,netConnection_eventHandler);
netStream.attachCamera(cam);
netStream.attachAudio(mic);
netStream.publish(XXXX, "record");
谢谢,科比。