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

Code for stop button that will stop the video and go to the beginning of the video in Animate CC

New Here ,
Mar 23, 2018 Mar 23, 2018

I am looking for how to code (code snippet) a stop button for a video inside of HTML5 Canvas.  I want the button to stop the video and go to the beginning of the video but not play the video.  Here is my code (actions) so far:  Thanks in advance.

this.playBtn.dyn.text = "play";

this.pauseBtn.dyn.text = "pause";

this.stopBtn.dyn.text = "stop";

this.playBtn.addEventListener("click", fl_MouseClickHandler_4.bind(this));

function fl_MouseClickHandler_4()

{

     $("#myVideo")[0].play();

}

this.pauseBtn.addEventListener("click", fl_MouseClickHandler_5.bind(this));

function fl_MouseClickHandler_5()

{

     $("#myVideo")[0].pause();

}

1.5K
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

correct answers 1 Correct answer

Community Expert , Apr 02, 2018 Apr 02, 2018

Hi.

One possible solution would be to pause the video and set its current time to 0.

function onStopVideo(e)

{

     $("#video0")[0].pause();

     $("#video0")[0].currentTime = 0;

}

Translate
Adobe Employee ,
Apr 02, 2018 Apr 02, 2018

Because no one has answered this one so far, have a look at this article for insights Adobe ActionScript 3.0 * Controlling movie clip playback

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 ,
Apr 02, 2018 Apr 02, 2018
LATEST

Hi.

One possible solution would be to pause the video and set its current time to 0.

function onStopVideo(e)

{

     $("#video0")[0].pause();

     $("#video0")[0].currentTime = 0;

}

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