2015-04-15 48 views

回答

1

StageVideoVideo都使用NetStream(這是實際的視頻內容)。這是您聽取與內容相關的事件的地方。

因此,如果您當前正在使用所鏈接的組件播放視頻,則應該已有NetStream對象。

下面是一個例子:

var stream:NetStream = ...//your net stream object you should already have to play the video, assumption here is you already have it instantiated. 

stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler,false,0,true); 

function netStatusHandler(event:NetStatusEvent):void { 
    switch (event.info.code) { 
     case "NetStream.Play.StreamNotFound": 
      //the video wasn't found, better tell the user something 
      break; 

     case "NetStream.Play.Start": 
      //video started playing 
      break; 

     case "NetStream.Play.Stop": 
      videoFinishedHandler(); //do something now that the video is finished playing 
      break; 
    } 
} 

如果你想看看你可以攔截所有其他NetStream狀態事件的列表,請參閱the documentation

+0

感謝,更重要的是,試圖找出如何正確使用多個stageVideo對象。毫無疑問,缺少文檔! http://stackoverflow.com/questions/29659660/as3-stagevideo-controlling-depth-of-multiple-stage-video-instances –