Hi,
I am using AIR on mobile for streaming a video from a VideoDisplay object to FMS (Flash Media Server) using NetConnection and NetStream.
It's working, but 50% of the videos are being cut off in the middle. The FLV file on the server is small. Somehow the streaming just stoppes. I guess it has something to do with mobile connectivity, but this happens both on 3G connections and WiFi connections.
Here is some code:
private function CreateConnection():void
{
nc = new NetConnection();
nc.client = this;
nc.objectEncoding = flash.net.ObjectEncoding.AMF3;
nc.connect(rtmpPath);
nc.addEventListener("netStatus", netConnection_eventHandler);
}
private function netConnection_eventHandler(event:NetStatusEvent):void{
if (event.info.code == "NetConnection.Connect.Success")
{
nc.call("checkBandwidth", null);
}
return;
}
public function onBWDone(... rest):void
{
CreateConnection(); |
nsPublish = new NetStream(nc, NetStream.CONNECT_TO_FMS);
nsPublish.addEventListener(NetStatusEvent.NET_STA TUS,netConnection_eventHandler);
nsPublish.attachCamera(cam);
nsPublish.attachAudio(mic);
nsPublish.publish(InterviewID, "record");
}
All help or suggestions will be highly appreciated.
Koby.