I’m having a bit of a problem setting and seeking using AS cue points for a FLV file running in a Flash file. I’m trying to seek (using “seekSeconds”) to different parts of the FLV video and end the segment based on reaching these AS cue points “end points”. There are about 50 labelled “screens” in the Flash file, each will require a “seek” to a different position in the the FLV file and need an AS cuepoint end-point. The code below works great…the first time around. If you leave the “labelled” frame and return the seek at AS cuepoint “WishEnd1” (VideoWindow.seekSeconds(22.5); ) stutters…1 time if you jump and return twice; twice if you jump and return thrice. The trace shows the “WishEnd1” cue point is repeating as if the “if” statement is reading it multiple times when returning. This is one long 30 minutes video that I’d like to jump around in. I’ve mapped out the seek times for start each segment, but want to use AS cue points to end each segment. Is it possible each time I set the AS cuepoint it is adding multiple copies of the same one at slightly different times? Notice, I’m trying to “removeASCuePoint” to cue points so as to start fresh each time. (FYI, the FLV was converted without embedded cuepoints, but with a keyframe every 10 frames to improve the “seekSeconds” accuracy.)
Does anybody have experience with this type of implementation…and have a solution??
Thanks.
import mx.video.FLVPlayback;
var VideoWindow:FLVPlayback;
VideoWindow.contentPath = “Wish-Frames10.flv”;
VideoWindow.removeASCuePoint(“wishEnd1”);
VideoWindow.removeASCuePoint(“wishEnd2”);
//Set first cue point for jump/stop
var cuePt:Object = new Object();
cuePt.time = 10.000;
cuePt.name = “wishEnd1”;
cuePt.type = “actionscript”;
// Add AS cue point.
VideoWindow.addASCuePoint(cuePt);
// Add another AS cue point.
VideoWindow.addASCuePoint(79.000, “wishEnd2”);
VideoWindow.autoPlay = false;
//_root.VideoWindow.rewind();
//Seek to first segment
VideoWindow.seekSeconds(0);
VideoWindow.play();
// Listen for cue points and jump cut or stop
var listenerObject:Object = new Object();
listenerObject.cuePoint = function(eventObject:Object):Void {
var cuePtName = eventObject.info.name;
if (cuePtName == “wishEnd1”){
//Seek to second segment
VideoWindow.seekSeconds(22.5);
trace(cuePtName);
VideoWindow.removeASCuePoint(cuePtName);
}
if (cuePtName == “wishEnd2”) {
//End last segment
//trace(cuePtName);
VideoWindow.removeASCuePoint(cuePtName);
VideoWindow.stop();
}
};
VideoWindow.addEventListener(“cuePoint”,listenerObject);
//If Video OFF
} else {
_global.video = “OFF”;
//_root.Video_mc.visible = false;
videoX._visible = false;
VideoWindow._visible = false;
MovieFrame_mc._visible = false;
}