Search code examples
actionscript-3flex4red5netstream

Why NetStream#togglePause() do not work?


I create a record audio application based on red5 0.9 version.

Below is my flex client code snippets. My red5 server work fine.

private var playStream:NetStream;

private function playRecord(event:MouseEvent):void{
  if(isPausing){
    playStream.togglePause();
  }else{
    playStream=getStream();
    playStream.bufferTime=15;
    playStream.play(streamName);
  }
}

private function pauseRecord(event:MouseEvent):void{
  playStream.togglePause();
}

I press pause button fine, but when i press play button, the audio always play form the begining.

Why? do i need to clean up NetStream Buffer?


Solution

  • I found solution myself.

    playStream.maxPauseBufferTime=0;