1
使用此SimpleStageVideo包裝器用於AS3 AIR錄像機。AS3 StageVideo,如何確定何時結束?
http://www.bytearray.org/?p=2571
我需要確定在視頻播放結束,但看不出有任何被觸發的事件。
任何人都可以提出一種解決方法嗎?
使用此SimpleStageVideo包裝器用於AS3 AIR錄像機。AS3 StageVideo,如何確定何時結束?
http://www.bytearray.org/?p=2571
我需要確定在視頻播放結束,但看不出有任何被觸發的事件。
任何人都可以提出一種解決方法嗎?
StageVideo
和Video
都使用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
感謝,更重要的是,試圖找出如何正確使用多個stageVideo對象。毫無疑問,缺少文檔! http://stackoverflow.com/questions/29659660/as3-stagevideo-controlling-depth-of-multiple-stage-video-instances –