在开始播放电影之前,我添加了几个提示点,然后注册回调,并在每次命中时进行跟踪,如下所示:
private function onCuePoint(evt:CuePointEvent):void {
var cuePointObject:Object = {name:evt.cuePointName, time:evt.cuePointTime, type:evt.cuePointType};
trace("onCuePoint: " + evt.cuePointName + "=" + cueDict[evt.cuePointName] + " @t=" + cuePointObject.time + " playtime=" + playheadTime);
}
您会认为cuePointObject.time大致等于电影的playheadTime。这是输出:
onCuePoint: cue3.4=cue3.4 @t=5.6 playtime=5.611
onCuePoint: cue1=cue1 @t=1 playtime=5.611
onCuePoint: cue2=cue2 @t=3 playtime=5.611
onCuePoint: cue2=cue2 @t=5 playtime=5.611
onCuePoint: cue3.1=cue3.1 @t=5 playtime=5.611
onCuePoint: cue3.1=cue3.1 @t=5.2 playtime=5.611
onCuePoint: cue3.2=cue3.2 @t=5.2 playtime=5.611
onCuePoint: cue3.2=cue3.2 @t=5.4 playtime=5.611
onCuePoint: cue3.3=cue3.3 @t=5.4 playtime=5.611
onCuePoint: cue3.3=cue3.3 @t=5.6000000000000005 playtime=5.611
onCuePoint: cue3.4=cue3.4 @t=5.8 playtime=5.888
onCuePoint: cue3.5=cue3.5 @t=5.8 playtime=5.888
onCuePoint: cue4=cue4 @t=10 playtime=9.92
onCuePoint: cue1=cue1 @t=11 playtime=11.221
看起来好像它等到“cue3.4”被触发,然后由于某种原因其余的跟随。它们作为数组添加到视频中,大致按照它们应该出现的顺序排序,因此 cue3.4 不是第一个。