Highlighted

Unable to detect end of video for GoToAndPlay frame number since update on HTML5 Canvas

Community Beginner ,
Dec 26, 2019

Copy link to clipboard

Copied

Our digital project uses a video component to serve an mp4 video. We used the following code to detect when the video had ended, then GoToAndPlay a new frame. Since the update, this code no longer detects the end of the video, and the scene comes to a stop. 

The Code (placed on frame 1 on root timeline):

var _this = this;

_this.scene1_mc.on("added", funcion (){

      $("#scene1_mc").on("ended", function () {
             this.gotoAndPlay(42);

      });

});

Then the video component was named scene1_mc. This worked great all year, and still works on already published files. When publishing new ones, it breaks. Anyone know if any features relevant to this have been depreciated?

 

Adobe Community Professional
Correct answer by ClayUUID | Adobe Community Professional

The video component is just a thin wrapper around a native HTML5 <video> element, so Animate has no say about which events it fires. What's probably happening is that the event listener isn't being assigned at all. For example, if you misspelled "function" as "funcion" in your code.

 

Try sticking an alert("HELLO!"); statement in your "added" event handler to verify that it's actually running.

TOPICS
ActionScript, Publish package

Views

93

Likes

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

Unable to detect end of video for GoToAndPlay frame number since update on HTML5 Canvas

Community Beginner ,
Dec 26, 2019

Copy link to clipboard

Copied

Our digital project uses a video component to serve an mp4 video. We used the following code to detect when the video had ended, then GoToAndPlay a new frame. Since the update, this code no longer detects the end of the video, and the scene comes to a stop. 

The Code (placed on frame 1 on root timeline):

var _this = this;

_this.scene1_mc.on("added", funcion (){

      $("#scene1_mc").on("ended", function () {
             this.gotoAndPlay(42);

      });

});

Then the video component was named scene1_mc. This worked great all year, and still works on already published files. When publishing new ones, it breaks. Anyone know if any features relevant to this have been depreciated?

 

Adobe Community Professional
Correct answer by ClayUUID | Adobe Community Professional

The video component is just a thin wrapper around a native HTML5 <video> element, so Animate has no say about which events it fires. What's probably happening is that the event listener isn't being assigned at all. For example, if you misspelled "function" as "funcion" in your code.

 

Try sticking an alert("HELLO!"); statement in your "added" event handler to verify that it's actually running.

TOPICS
ActionScript, Publish package

Views

94

Likes

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
Dec 26, 2019 0
Adobe Community Professional ,
Dec 26, 2019

Copy link to clipboard

Copied

The video component is just a thin wrapper around a native HTML5 <video> element, so Animate has no say about which events it fires. What's probably happening is that the event listener isn't being assigned at all. For example, if you misspelled "function" as "funcion" in your code.

 

Try sticking an alert("HELLO!"); statement in your "added" event handler to verify that it's actually running.

Likes

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
Reply
Loading...
Dec 26, 2019 0