The DotLottiePlugin abstract class is available here
dotLottie uses a plugin system to allow for flexibility and customization of the dotLottie creation pipeline. Plugins are called on during the build() phase where animation data and image assets have been fetched. Plugins can then act upon the dotLottie context of these animations and modify the data. Some use cases could be to optimize the file size of image assets, run an optimization algorithm on the animation data, run tests..
In this example, we show how the duplicate image detecting plugin is made.
Creating a custom plugin
Create your plugin class
Implement your onBuild(): Promise<void> method
Don’t forget to add your plugin to your DotLottie instance
Plugins’ onBuild() method is called when calling build() on the dotLottie instance