0 Replies Latest reply on Nov 4, 2011 7:22 AM by user23890123

    Flex Mobile - How to remove audio from a NetStream without freezing the application?

    user23890123

      Hi,

       

      I'm working on an application that streams audio and video to another phone, using flash media server. I can get the audio and video to stream just fine, but oddly enough stopping the streams is where I'm having difficulty. When I close my outgoing stream the application freezes up and becomes incredibly slow, but only after somebody else has viewed the stream (even if they have stopped viewing it).

       

      I determined that the cause of the freeze up is stopping the audio stream, because when I call outgoingStream.attachAudio(null); the application freezes in the same way as when I close the stream altogether. outgoingStream.attachCamera(null) stops the video just fine, so I assumed this was the method to stop the audio as well. How can I close the stream, or stop the audio without the application freezing up? What could I be doing wrong?

       

      Additional info:

      I'm testing this on an Android HTC Desire Z, and an ASUS android tablet (both have the same issue)

      I'm using Flex 4.5.1 with Air 3.0

      I'm using Flash Media Server 4.5

       

      Full code for how I stop the video and audio streams:

       

      localVideoDisplay.removeChildren(); // localVideoDisplay is a UIElement that holds the localVideo object.

      localVideo = null;                            // localVideo is what the camera attaches to, to be seen locally.

      if (outgoingStream)                          // outgoingStream is the NetStream that the camera and microphone attach to, to be streamed.

      {

           outgoingStream.attachAudio(null);

           outgoingStream.attachCamera(null);

           outgoingStream.close();

      }