airbnb / lottie-web

Render After Effects animations natively on Web, Android and iOS, and React Native. http://airbnb.io/lottie/
MIT License
29.86k stars 2.85k forks source link

`DOMLoaded` not called for OffscreenCanvas renderer #2908

Closed renspoesse closed 1 year ago

renspoesse commented 1 year ago

When using the Canvas renderer with the Web Worker build, the DOMLoaded event doesn't fire on the animation item. I think it's because of this line:

https://github.com/airbnb/lottie-web/blob/3fb61fd3d37b8fe7bed1d5e833c4f5a34af24d16/player/js/worker_wrapper.js#L209

As far as I know this is the only event to detect whether an animation has completely loaded and play() can be called on the instance. So it should probably work in this scenario?

renspoesse commented 1 year ago

The same goes for drawnFrame, to make the enterFrame event work.

renspoesse commented 1 year ago

DOMLoaded: https://github.com/airbnb/lottie-web/commit/8e0525c6aec018e3b815aa9ae62f176b020b21fa