Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animation stutter in Chrome #964

Open
theinteresthunter opened this issue May 29, 2018 · 16 comments
Open

Animation stutter in Chrome #964

theinteresthunter opened this issue May 29, 2018 · 16 comments

Comments

@theinteresthunter
Copy link

theinteresthunter commented May 29, 2018

I’ve created a lot of animated ads with Adobe Animate CC (using EaselJS/CreateJS) and have been disappointed with the stutter playback on Chrome. (I'm using 66.0.3359.181. My clients see the same issue too, but I don't know what browser they're using.)

I imagine you're aware of the issue. To enable you brilliant people to help solve this problem, I’ve created a simple version of the issue. Here, I have 3 cat images that animate from left to right. The images are only 300x250px and about 28k each.

I’m trying to solve the specific problem of getting rid of the stutter/jerkiness that happens as the images travel from left to right. Do you have any suggestions?

It works pretty smoothly in Safari and Firefox. Chrome shows significant stutter.

See Version A - Made with Animate CC
Stutters heavily in Chrome

See Version B - Made with Google Web Designer (GWD).
Smooth as butter in Chrome. No issues.
I realize Version B is not a fair comparison to Version A since GWD isn’t using canvas or createjs.

Download the files.

Any thoughts? I've also posted this issue here in Adobe Animate CC's forum.

@sebastianderossi
Copy link

I am unable to run Version B in Chrome

Failed to load resource: net::ERR_BLOCKED_BY_CLIENT
(index):73 Uncaught ReferenceError: Enabler is not defined
    at HTMLElement.f.attachedCallback ((index):73)
(index):78 Uncaught ReferenceError: Enabler is not defined
    at HTMLElement.f.initAd ((index):78)
    at (index):132

@sebastianderossi
Copy link

Also the .zip link seems broken. I am getting a 404 error.

@theinteresthunter
Copy link
Author

Try this one: Version B2.
(Made for non-DoubleClick ad environment.)

@sebastianderossi
Copy link

No errors but unfortunately no images displayed.

@sebastianderossi
Copy link

@theinteresthunter Testing on Chrome Version 67.0.3396.62 (Official Build) (64-bit) Version A doesn't appear to be "jerky" Have you tried using version 1.0.0?

@MannyC
Copy link
Contributor

MannyC commented May 30, 2018

Not jerky for me either Version 67.0.3396.62 (Official Build) (64-bit) Linux

@theinteresthunter
Copy link
Author

@sebastianderossi I've corrected the zip download link.
Also, I added a Version A3 above that uses CreateJS version 1.0.0.

@sebastianderossi
Copy link

@theinteresthunter I downloaded your latest source. 300x250a_animate is still pointing to an older version of the combined libs. I have updated the source to v1.0.0 and changed the timing mode to RAF. Have a look at the results (Left: original export, Middle:GWD, Right: Updated version). So I wouldn't say anything is wrong with the export per se, I would say that the frequency of rendering might be different. Switching from using framerate to requestAnimationFrame does make a difference

createjs.Ticker.timingMode = createjs.Ticker.RAF;

In this mode, Ticker passes through the requestAnimationFrame heartbeat, ignoring the target framerate completely. Because requestAnimationFrame frequency is not deterministic, any content using this mode should be time based.

@CoIin
Copy link

CoIin commented May 30, 2018

I was testing this in the forum, and the jerkiness is subtle on my Mac, but Safari is clearly smoother. I dare say that Javascript in general runs faster in Safari, and maybe it's for Google to improve the performance of Chrome.

I'm curious about RAF, when applied to animations done in Adobe Animate, so I'll give that a try. I'm working on something that plays well on iPhone but poorly on Android, maybe RAF will help there.

@gskinner
Copy link
Member

gskinner commented May 30, 2018

Regarding RAF, you can also use createjs.Ticker.RAF_SYNCHED. This will attempt to preserve your framerate while using requestAnimationFrame. It works best if your target framerate divides neatly into 60 (ex. 15, 20, 30).

Another option is to use the framerate property on MovieClip to synch the MC playback to time. The AdHelper.timeSync method demonstrates a (slightly hacky) way to apply this logic to all of your MovieClip instances.

https://github.com/CreateJS/html5ads/blob/acc307901503f2ac61511d94ab96a6191d315904/AdHelper/AdHelper.js#L274

@CoIin
Copy link

CoIin commented May 31, 2018

Which of these options ends up skipping frames? One worry is that if you have code on keyframes that it might get skipped. Like, if you have this.stop(); at the end of an intro animation. If that was skipped the animation would run through whatever was next in the timeline.

@lannymcnie
Copy link
Member

lannymcnie commented May 31, 2018

MovieClip will skip visual frames to maintain a framerate, but will never skip frame actions.

@CoIin
Copy link

CoIin commented May 31, 2018

Thanks, that's good to know.

@gskinner
Copy link
Member

gskinner commented Jun 1, 2018

To add to this a bit:
RAF_SYNCHED will always advance one frame at a time, it will just try to do that in sync with the RAF heartbeat. It won't ever skip displaying a frame.

framerate will skip displaying frames, but it actually advances through each of them to ensure code runs correctly. However, unless you're authoring content at >60fps, it's rare that it will skip frames at all.

@CoIin
Copy link

CoIin commented Jun 1, 2018

In my particular case I have something that works fine on iPhone, but is slow on new Android phones, and very slow on older Android phones. If I'm set to 30 fps, what would be a safe way to have an older Android phone complete five seconds of animation in five seconds of time, without missing frames with code? Is that what framerate would do?

@raisen
Copy link

raisen commented Oct 29, 2018

In my particular case I have something that works fine on iPhone, but is slow on new Android phones, and very slow on older Android phones. If I'm set to 30 fps, what would be a safe way to have an older Android phone complete five seconds of animation in five seconds of time, without missing frames with code? Is that what framerate would do?

I'm having similar problems, were you able to figure out a solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants