Apache flex 为什么我要关闭NetStream.Connect.com?
当我执行以下操作时:Apache flex 为什么我要关闭NetStream.Connect.com?,apache-flex,actionscript-3,flashplayer-10,adobe-cirrus,Apache 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, ne
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);
}
Connecting to: 8640d30e760528b2c88662eacef67d693527e52549eb5e29fc405355a7db147e
NetStream.Connect.Closed
为ID使用有效字符串,我得到以下结果:
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);
}
Connecting to: 8640d30e760528b2c88662eacef67d693527e52549eb5e29fc405355a7db147e
NetStream.Connect.Closed
我正在等待
NetStream.Connect.Success
,因为我正在为theirID
传递一个有效的字符串。知道为什么会发生这种情况吗?您正在初始化网络连接吗?此外,您连接到的流可能没有发布“媒体”
您要连接的客户端必须执行sendStream.publish(“媒体”)您正在初始化网络连接吗?此外,您连接到的流可能没有发布“媒体”
您要连接的客户端必须执行sendStream.publish(“媒体”)在使用此功能之前,您需要连接到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'){
}
}
使用前,您需要连接到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'){
}
}