1
我已經使用AS3 flash.media.Video對象(不是FLV播放組件)創建了FLV視頻播放器,並且我試圖偵聽嵌入式事件和提示點在FLV視頻中,但當我追蹤電影時我沒有收到任何內容。提示點不是動態創建的,它們位於FLV視頻中。使用AS3視頻對象(非組件)檢測NetStream事件
視頻嵌入代碼:同一類
// Initialize net stream
nc = new NetConnection();
nc.connect (null); // Not using a media server.
ns = new NetStream(nc);
// Add video to stage
vid = new Video(456,675);
addChild (vid);
// Add callback method for listening on
// NetStream meta data
client = new Object();
ns.client = client;
client.onMetaData = this.nsMetaDataCallback;
client.onCuePoint = this.onCuePoint;
// Play video
vid.attachNetStream (ns);
ns.play ("flv/00_010.flv");
回調處理程序將上述代碼:
public function onCuePoint(info:Object):void {
trace("cuePoint: time = " + info.time + " name = " + info.name + " type = " + info.type);
if (ns) ns.pause();
}
public function nsMetaDataCallback (mdata:Object):void {
trace (mdata.duration);
}
有什麼我缺少有錯捕獲從我的淨流事件?
我覺得你的代碼沒問題,但flv文件本身可能有問題。嘗試使用另一個文件。 – 2010-03-19 05:58:08