Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/drupal/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 为什么NetStreamtogglePause()不起作用?_Actionscript 3_Flex4_Red5_Netstream - Fatal编程技术网

Actionscript 3 为什么NetStreamtogglePause()不起作用?

Actionscript 3 为什么NetStreamtogglePause()不起作用?,actionscript-3,flex4,red5,netstream,Actionscript 3,Flex4,Red5,Netstream,我创建了一个基于red5 0.9版本的录制音频应用程序 下面是我的flex客户端代码片段。我的red5服务器工作正常 private var playStream:NetStream; private function playRecord(event:MouseEvent):void{ if(isPausing){ playStream.togglePause(); }else{ playStream=getStream(); playStream.buffe

我创建了一个基于red5 0.9版本的录制音频应用程序

下面是我的flex客户端代码片段。我的red5服务器工作正常

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();
}
我按暂停按钮很好,但当我按播放按钮时,音频总是从一开始就播放


为什么??我需要清理NetStream缓冲区吗?

我自己找到了解决方案

playStream.maxPauseBufferTime=0;