2 Replies Latest reply on May 8, 2010 2:24 PM by Michael Thornburgh

    NetStream.Play.Failed - Simple video chat application

    mark180887

      Hi,

       

      I am trying to build a simple p2p video chat application using Stratus. I have successfully managed to create a NetGroup and can use the 'post' function to transfer text chat between clients.

       

      However, I encounter a problem with playing streaming video/audio between peers in the NetGroup.

       

      I have simplied my problem so that I have just two clients in my NetGroup, A and B.

      A can publish to the NetGroup and B can connect to A's NetStream, firing a "NetStream.Connect.Success" event on B, but B can not play A's stream using the 'play' method.

       

      I get a "NetStream.Play.Failed" error on B. After looking at the documentation, it seems to be a security issue, but I can't find any other way of finding out more about the error.

       

      Does anyone know what's going wrong? or how I can get a more descriptive error message?

      Does anyone know of a good p2p video chat tutorial using Stratus 2?

       

      Thanks.

       

       

      Here is my NetGroup definition:

       

       

      var groupSpecifier = new GroupSpecifier("TEST" + randomNumberString);
      groupSpecifier.postingEnabled = true;
      groupSpecifier.serverChannelEnabled = true;
      groupSpecifier.multicastEnabled = true;
      groupSpecifier.routingEnabled = true;

      netGroup = new NetGroup(stratus, groupSpecifier.groupspecWithoutAuthorizations());

      netGroup.addEventListener(NetStatusEvent.NET_STATUS, stratusHandler);

       

       

      Here's a sample of the NetStatusEvent Handler on B:

       

       

      private function stratusHandler(event:NetStatusEvent):void
      {
         switch(event.info.code)
         {
         case "NetStream.Connect.Success":
                event.info.stream.play("A_stream");     //play stream from A.

                break;

         }

      }