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

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

Participant ,
Nov 29, 2016 Nov 29, 2016

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!

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

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.

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

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

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
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.

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

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