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

How to add a "ended" event listener to HTML5 video in Animate CC?

Participant ,
Nov 29, 2016 Nov 29, 2016

Copy link to clipboard

Copied

I added a video as a DOM, it works wonderfully, triggers when I need it to, but I cant find a way to listen to when the video is finished.

Traditional myVideo.addEventListener('ended', handledEnded etc does not seem to work

I couldnt find anything in createjs reference pertaining to video events.  Could anyone advise?

Thank you!

Views

2.2K

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

correct answers 1 Correct answer

LEGEND , Nov 29, 2016 Nov 29, 2016

That is indeed the correct way to check for a media file ending. How are you setting the value of "myVideo"? You should be doing something like this:

var myVideo = document.getElementById("thisismyvideofile");

If you're using the HTML components, Animate sets the ID of the video element to the same as the instance name.

You should also set an "error" listener pointing to the same handler as "ended", so people don't get stuck if video playback fails.

Votes

Translate

Translate
Community Expert ,
Nov 29, 2016 Nov 29, 2016

Copy link to clipboard

Copied

Moved out of the Forum Lounge (not for technical support) and over to the Adobe Animate CC - General forum.

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
LEGEND ,
Nov 29, 2016 Nov 29, 2016

Copy link to clipboard

Copied

That is indeed the correct way to check for a media file ending. How are you setting the value of "myVideo"? You should be doing something like this:

var myVideo = document.getElementById("thisismyvideofile");

If you're using the HTML components, Animate sets the ID of the video element to the same as the instance name.

You should also set an "error" listener pointing to the same handler as "ended", so people don't get stuck if video playback fails.

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
Participant ,
Nov 29, 2016 Nov 29, 2016

Copy link to clipboard

Copied

LATEST

ok, I was doing exactly that, but I goofed up and was setting up event listener on the div id, no the video id.  Thank you for 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