Copy link to clipboard
Copied
So I've been working with FLVPlayback component for external video and overall it's been working well. When I embed cue points using Adobe Media Encoder, scripted commands that reference the cue points work flawlessly. BUT, when I use AS3 to program cue points, I run into a lot of issues that I can't find work arounds for. In particular the 'seekToPrevNavCuePoint' command won't work using Script Cue points.
Below is the Cue Point script and Cuepoint finder functions I'm using. Each of seektoNextNavCuePoint & seekToPrevNavCuePoint commands DON'T WORK and they pause the video yet I DON'T get any debug errors. Similarly, flvControl2.seekToNavCuePoint("cuepoint") also does not work and generates a '1003: Invalid Seek' error.
Same time, flvControl2.seek(vidSlides.findCuePoint("slide2")["time"]); does work to navigate directly to cue points for whatever reason? Per the Adobe literature on the FLVPlayback component, the above commands should work OR I'm missing something in my scripting?
I've come across several unanswered strings on this subject.. would love to help the community and figure out why this component behaves the way it does. If anyone has insight into this idiosyncrasy I would greatly appreciate it!!
SCRIPT:
//Cue Point programming where 'vidSlides' is the instance named of the FLVPlayback component:
import fl.video.*;
import fl.video.MetadataEvent;
import flash.display.*;
import flash.events.Event;
import flash.events.KeyboardEvent;
vidSlides.source = "Safe16x9_slides.mov"; //vidSlides is instance name of Flvplayback Component
// Video component instance name
var flvControl2:FLVPlayback = vidSlides;
// Set video
flvControl2.source = "Safe16x9_slides.mov";
//scripted Cue Points
flvControl2.addASCuePoint(.25,"start");
flvControl2.addASCuePoint(2.06,"slide1");
flvControl2.addASCuePoint(3.83,"slide2");
flvControl2.addASCuePoint(9.47,"slide3");
flvControl2.addASCuePoint(15.58,"slide4");
flvControl2.addASCuePoint(21.52,"slide5");
flvControl2.addASCuePoint(28.26,"slide6");
flvControl2.addASCuePoint(30.26,"slide7");
flvControl2.addASCuePoint(33.13,"slide8");
flvControl2.addASCuePoint(39.90,"end");
// jump to Cue Points
stage.addEventListener(KeyboardEvent.KEY_DOWN, seekHandler);
function seekHandler(event:KeyboardEvent):void
{
if(event.keyCode == 39)
{
flvControl2.seekToNextNavCuePoint();
}
else if(event.keyCode == 37)
{
flvControl2.seekToPrevNavCuePoint();
}
else if(event.keyCode == 50)
{
flvControl2.seek(vidSlides.findCuePoint("slide2")["time"]);
}
else if(event.keyCode == 51)
{
flvControl2.seek(vidSlides.findCuePoint("slide3")["time"]);
}
else if(event.keyCode == 52)
{
flvControl2.seek(vidSlides.findCuePoint("slide4")["time"]);
}
}
Have something to add?