2011-07-06 3 views
0

AS3에서 작은 비디오 플레이어를 만들고 있는데 NetStream.pause() 또는 NetStream.togglePause()를 호출 한 후 상태 메시지가 나타나지 않습니다. 더 이상 해고되고있다. 비디오가 버퍼링되는 동안 "일시 중지"버튼을 클릭하면 Buffer.Full 메시지가 표시되지 않습니다.NetStream.Buffer.Full이 NetStream.pause 호출 후 종료되지 않았습니다.

_connection = new NetConnection(); 
_connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); 
_connection.connect(null); 

// create NetStream instance 
_stream = new NetStream(_connection); 
_stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); 

// event handler 
// not called after the stream has been paused 
private function netStatusHandler(e:NetStatusEvent):void 
{ 
    trace("code:", e.info.code); 
} 

// pause button click handler 
private function videoClickHandler(e:MouseEvent):void 
{ 
    _stream.togglePause(); 
    _isPaused = !_isPaused; 
    controls.playPause.gotoAndPlay((_isPaused) ? 10 : 3); 
} 

내가 여기 실종 무엇 : 여기

몇 가지 코드?

감사합니다.

+0

는 _connection –

+0

내가 코드가 나에게 끈적 거리는 보이는 연결 – dotminic

+1

서버로의 연결이 이루어지고 확신을 생성하는 방법을 보여하는 코드를 업데이트 생성하는 방법을 보여줍니다. 그리고 스트림 iws 서버에서 전송되는? 일반적으로 스트리밍 미디어를 사용하면 서버 기능을 호출해야합니다. 어떤 스트리밍 서버를 사용하고 있습니까? –

답변

0
_connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); 
_connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler); 
0

너무 늦었지만 같은 문제가 발생했습니다. NetStream.Unpause.Notify를 수신 할 때 bufferLength가 bufferTime보다 큰지 확인하여 문제를 해결할 수있었습니다.

이 유사 코드 :

switch(event.info.code) { 
     case 'NetStream.Play.Start': 
     case 'NetStream.Buffer.Full': 
      currentState = 'playing'; 
      return; 
     case 'NetStream.Unpause.Notify': 
      if (this.ns.bufferLength >= this.ns.bufferTime) 
       currentState = 'playing'; 
      return; 
     case 'NetStream.Pause.Notify': 
      currentState = 'paused'; 
      return; 
    }