我已经使用 AS3 flash.media.Video 对象(不是 FLV 播放组件)创建了一个 FLV 视频播放器,我正在尝试侦听 FLV 视频中嵌入的元事件和提示点,但是当我跟踪电影。提示点不是动态创建的,它们位于 FLV 视频中。
视频嵌入代码:
// 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);
}
从我的网络流中捕获事件有什么我错过的吗?