0 Replies Latest reply on May 2, 2009 11:19 AM by iidan_i

    Issue with Stratus

    iidan_i

      Hello,

      When I read about Stratus I was thrilled, It seemed perfect for the chat I wanted to create.
      sadly, when I tried to write a simple program to test it I had a problem,
      The stream does not play.

      Here is my code:

      // declaring Startus address 
      const StratusAddress:String = "rtmfp://stratus.adobe.com"; 
      const DeveloperKey:String = "0c0b5fa386d7c2035ca71ed8-97e0fab74224"; 
      
      var nc1:NetConnection = new NetConnection(); 
      var nc2:NetConnection = new NetConnection(); 
      
      function sendStreamHandler(ev:NetStatusEvent):void{ 
      trace("publishing: " + ev.info.code); 
      } 
      
      function ncHandler1(ev:NetStatusEvent):void{ 
      trace(ev.info.code); 
      if(ev.info.code == "NetConnection.Connect.Success"){ 
      trace(nc1.nearID); 
      var sendStream:NetStream = new NetStream(nc1, NetStream.DIRECT_CONNECTIONS); 
      sendStream.addEventListener(NetStatusEvent.NET_STATUS, 
      sendStreamHandler); 
      sendStream.publish("media"); 
      sendStream.attachAudio(Microphone.getMicrophone()); 
      sendStream.attachCamera(Camera.getCamera()); 
      
      // after the first client is connected, we'll connnect a second one 
      // to recieve the stream 
      nc2.addEventListener(NetStatusEvent.NET_STATUS, 
      ncHandler2); 
      nc2.connect(StratusAddress + "/" + DeveloperKey); 
      } 
      } 
      
      
      function recvStreamHandler(ev:NetStatusEvent):void{ 
      trace("recieving : " + ev.info.code); 
      } 
      
      function ncHandler2(ev:NetStatusEvent):void{ 
      trace(ev.info.code); 
      if(ev.info.code == "NetConnection.Connect.Success"){ 
      trace(nc1.nearID); 
      
      //create video object thingy 
      var myVideo:Video = new Video(); 
      addChild(myVideo); 
      
      //recieving stream 
      var recvStream:NetStream = new NetStream(nc2, nc1.nearID); 
      
      recvStream.addEventListener(NetStatusEvent.NET_STATUS, recvStreamHandler); 
      recvStream.play("media"); 
      } 
      } 
      
      // Connecting the first client. 
      nc1.addEventListener(NetStatusEvent.NET_STATUS, 
      ncHandler1); 
      nc1.connect(StratusAddress + "/" + DeveloperKey); 
      
      

       

      Output:

      NetConnection.Connect.Success
      089890f0719621576c504e2b96ddf61e8ef49d9584afe051d1ee4cae57675fa2
      publishing: NetStream.Publish.Start
      NetConnection.Connect.Success
      089890f0719621576c504e2b96ddf61e8ef49d9584afe051d1ee4cae57675fa2
      

       

      But the recieving NetStream(recvStream) the onStatus function is never triggered(recvStreamHandler), as shown in the output...
      also, there is no video or audio.
      It's basicly the same code from the article(http://www.adobe.com/devnet/flashplayer/articles/rtmfp_stratus_app_print.html), and that's what drives me CrAzY!
      please Help me :-(

      thanks in advance.