Search code examples
flashactionscriptactionscript-2netstream

Can a NetStream publisher in Flash pause their stream?


I'm working on a webcam video streaming application utilizing Flash 8 (AS2) and Flash Media Server 3. Streaming the video live is fairly trivial, but I want to give the publisher the ability to pause their stream, effectively giving the people watching a snapshot instead of realtime video.

NetStream has a pause() method, but the documentation says it only applies to subscribers. Is there any way to pause the publishing of a stream?


Solution

  • Pause:

      ns.attachCamera(null);
    

    Resume:

      ns.attachCamera(Camera.getCamera());