moleproductions
Programmer
Hi,
I am trying to synchronise an FLV video with some pictures (which change as the video plays). Some might say - "Use something like Camtasia".
Well, I have done for the last 2 or 3 years and it has been great, up to a point. You can't really customise the template (only choose from 4 skins) you can't offer the user the option to switch to full screen video, you can't offer the user the chance to jump to the next slide (you can have some chapter markers in Camtasia but they are limiting) so all in all Camtasia is good, but for us it's time is coming to an end. People want more.
So, we have developed some very simple code (note that the FLVplayback object "videoPlayer" is already on the stage) and the following works:
When you play the video: at the start, at 5 and at 10 seconds the image updates with "img_1.jpg", "img_2.jpg", "img_3.jpg" etc.
However, the cue points only have an effect on the picture if the video is actually playing at the time the cue point is passed. In other words, if after 2 seconds you manually drag the slider to 7 seconds the 2nd cue point is missed and therefore you have to wait until the 3rd cue point for something to happen.
In a 10 second example, this hardly seems an issue - but imaging a presentation that has 2 or 3 minutes in between cue points. If the viewer drags the slider a few minutes ahead - completely the wrong picture will be showing - and it will continue to show for some time.
Can anyone think of a way of getting the script to look to see what the last cue point was and therefore update the picture immediately the video begins to play again?
I managed to do this in Lingo (Director MX and MX 2004) quite a few years ago and it worked really well. However, there seems to be such limited help around on AS3.
Thanks!
I am trying to synchronise an FLV video with some pictures (which change as the video plays). Some might say - "Use something like Camtasia".
Well, I have done for the last 2 or 3 years and it has been great, up to a point. You can't really customise the template (only choose from 4 skins) you can't offer the user the option to switch to full screen video, you can't offer the user the chance to jump to the next slide (you can have some chapter markers in Camtasia but they are limiting) so all in all Camtasia is good, but for us it's time is coming to an end. People want more.
So, we have developed some very simple code (note that the FLVplayback object "videoPlayer" is already on the stage) and the following works:
Code:
import fl.video.MetadataEvent;
videoPlayer.addASCuePoint(0,"caption",{text:"1"});
videoPlayer.addASCuePoint(5,"caption",{text:"2"});
videoPlayer.addASCuePoint(10,"caption",{text:"3"});
function changeSlide(num):void {
var slideImg:Loader = new Loader();
slideImg.load(new URLRequest("img_"+num+".jpg"));
addChild(slideImg);
}
videoPlayer.addEventListener(
MetadataEvent.CUE_POINT,
function(evt:MetadataEvent):void {
trace(evt.info.parameters.text);
changeSlide(evt.info.parameters.text);
}
);
When you play the video: at the start, at 5 and at 10 seconds the image updates with "img_1.jpg", "img_2.jpg", "img_3.jpg" etc.
However, the cue points only have an effect on the picture if the video is actually playing at the time the cue point is passed. In other words, if after 2 seconds you manually drag the slider to 7 seconds the 2nd cue point is missed and therefore you have to wait until the 3rd cue point for something to happen.
In a 10 second example, this hardly seems an issue - but imaging a presentation that has 2 or 3 minutes in between cue points. If the viewer drags the slider a few minutes ahead - completely the wrong picture will be showing - and it will continue to show for some time.
Can anyone think of a way of getting the script to look to see what the last cue point was and therefore update the picture immediately the video begins to play again?
I managed to do this in Lingo (Director MX and MX 2004) quite a few years ago and it worked really well. However, there seems to be such limited help around on AS3.
Thanks!