Copy link to clipboard
Copied
Hello,
I have read though several posts relating this this topic, but can not get a button to load after the end of a video.
Objective:
To detect the end of a MP4 video imported into the fist frame of timeline and once the end of video is reached a button displays (or advances timeline one frame to where a button resides so user can be linked to another page).
Thanks in advance.
Charlie
then the video's not imported "into the first frame of the timeline". it's imported using the video component.
so, if your component instance name is videoPlayer, you can use:
var video;
function checkInitF() {
if (video) {
video.addEventListener("ended", function(){
// video ended. do whatever
});
} else {
video = $("#videoPlayer")[0];
setTimeout(checkInitF, 100);
}
}
checkInitF();
Copy link to clipboard
Copied
if the video's on a timeline, start a timer loop (eg, ticker if html5, enterframe if as3) and repeatedly check if the last frame has played. if it has, stop the loop and do what with that
or even easier, just put a this.stop() on the last frame of the video or one frame beyond the video (if that's what you want) and put your button there.
Copy link to clipboard
Copied
Hi Kglad.
Thanks for the kind reply.
Those options make a lot of sense and certainly valid if the video is set across the root timeine. I'll further clarrify my situation:
I had to import the video using the Video Component and that places the entire video (1:59 in length) in the first keyframe as a self-contained video component. I'm under the impression that I need to do it this way to make it HTML5 Canvas compatible. (See image to viw how it is setup)
Any thoughts or maybe I'm misundertanting your answer. Or, my Animate skills are far where they shoud be. : )
Thanks,
Charlie
Copy link to clipboard
Copied
then the video's not imported "into the first frame of the timeline". it's imported using the video component.
so, if your component instance name is videoPlayer, you can use:
var video;
function checkInitF() {
if (video) {
video.addEventListener("ended", function(){
// video ended. do whatever
});
} else {
video = $("#videoPlayer")[0];
setTimeout(checkInitF, 100);
}
}
checkInitF();
Copy link to clipboard
Copied
Thank you very much.
I will give this a try.
C
Copy link to clipboard
Copied
Hi.
That works perfectly.
You rock!
Charlie
Copy link to clipboard
Copied
you're welcome.
p.s. mark that answer as correct and others will more easily find it.