Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Using embedded video component to trigger animation

New Here ,
May 28, 2025 May 28, 2025

I am trying to make it so on my stage, I dragged in a video component, set the path to a video using the component parameters, and when the video is at say 10 seconds, one layer isn't visible and another one is. Then at say 24 seconds into the video, that layer isn't visible and another one is etc. I couldn't find a good answer to how to use JavaScript to have this functionality so if anyone has some pointers that would be great! I have tried createjs.Ticker but that doesn't seem to like me and I always get console errors.

 

At the moment I have an array with all my cue points and which layer it makes visible (they're all hidden initially). All my attempts so far have resulted in nothing happening at all.

 

I see a lot of responses like, you can do it manually (as in using Adobe Animate's frames), but I need the animations to be triggered when the actual video is at a certain point. 

 

Thanks!

TOPICS
Code , Other
172
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 28, 2025 May 28, 2025

html5 or as3?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 28, 2025 May 28, 2025

HTML5!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 28, 2025 May 28, 2025

when currentTime is 10, 24 etc, do what you want:

 

var videoPlayer;
checkInitF();
function checkInitF() {
if (videoPlayer) {
videoPlayer.ontimeupdate = function() {
f();
}
} else {
videoPlayer = $("#videoPlayer")[0];  // videoPlayer is component instance name
setTimeout(checkInitF, 100);
}
}
 
function f(){
// videoPlayer.currentTime -  do whatever
}
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 04, 2025 Jun 04, 2025

Thank you so much for your answer, I didn't consider using jQuery and now I've tried that, it's working great, thank you!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 04, 2025 Jun 04, 2025
LATEST

you're welcome.

 

p.s. any time you add a component in animate html5, you add jqiuery support.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines