为什么我得到NetStream.Connect.Closed?

时间:2011-05-03 01:59:15

标签: flex actionscript-3 flashplayer-10 adobe-cirrus

执行以下操作时:

private function setUpRecvStream():void {
                writeText("Connecting to: " + theirID);
                recvStream = new NetStream(netConnection, theirID);
                recvStream.addEventListener(NetStatusEvent.NET_STATUS, netStreamHandler);
                //play the recvStream
                recvStream.play("media");
                //attach the stream videoRecv
                videoRecv.attachNetStream(recvStream);
            }

theirID使用vaild字符串我得到以下内容:

Connecting to: 8640d30e760528b2c88662eacef67d693527e52549eb5e29fc405355a7db147e 

NetStream.Connect.Closed

因为我传递NetStream.Connect.Success的字符串字符串,所以我期待theirID。有什么想法可能会发生这种情况吗?

2 个答案:

答案 0 :(得分:1)

您是否正在初始化netConnection?此外,您要连接的流可能不会发布“媒体”。

您要连接的客户端必须执行sendStream.publish(“media”)

答案 1 :(得分:0)

在使用之前,您需要连接到FMS

nc = new NetConnection();
nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusEvent);
nc.connect('rtmfp://stratus.adobe.com/cbd2224f9a56771b3d4d05c3-bd9b549abca2');

private function netStatusEvent(event:NetStatusEvent):void {
trace('NetConnection status event (1): ' + event.info.code);
    if (event.info.code == 'NetConnection.Connect.Success'){
    }
}