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

How do I make HTML5 play next frame after video component end?

Community Beginner ,
Sep 29, 2019 Sep 29, 2019

Copy link to clipboard

Copied

I place start button in the frame 0 and video component in the frame 1(only autoplay check) and 2(loop), if I assign "click to go to frame 1 and play" HTML5 will skip video 1 because it is only 1 frame duration if I assign "click to go to frame 1 and stop" it will end at video 1 last frame and not play video 2 at frame 4.
I want to make HTML5 play nextframe after video at frame 1 END.

Thank you for reading.

 

Views

2.0K

Translate

Translate

Report

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
LEGEND ,
Sep 30, 2019 Sep 30, 2019

Copy link to clipboard

Copied

this.stop();
var thisTimeline = this;

// video must not be set to autoplay
// video must not be set to loop

// wait until video component is fully initialized
stage.on("drawstart", initVideo, this, true);

// add event listener to video and tell it to play
function initVideo() {
	$("#myMovieClip")[0].addEventListener("ended", nextFrame);
	$("#myMovieClip")[0].play();
}

// remove event listener and continue
function nextFrame(evt) {
	evt.currentTarget.removeEventListener("ended", nextFrame);
	thisTimeline.gotoAndStop(thisTimeline.currentFrame + 1);
}

Votes

Translate

Translate

Report

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 Beginner ,
Oct 02, 2019 Oct 02, 2019

Copy link to clipboard

Copied

it work perfectly! Thank you for your help.

Votes

Translate

Translate

Report

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 Beginner ,
Nov 09, 2020 Nov 09, 2020

Copy link to clipboard

Copied

LATEST

I'm having a similar issue but once the video ends I want it to jump back to frame 1. Basically, I have 4 buttons, each jumping to different frames to autoplay their specific videos. Once the video ends I want to automatically jump back to frame 1. Any help? Thanks in advance! 

Votes

Translate

Translate

Report

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