LottieSharp icon indicating copy to clipboard operation
LottieSharp copied to clipboard

Allowing loading lottie content to be set from code behind

Open smartelligence opened this issue 5 years ago • 2 comments

Hi folks,

I will have lotties files stored within a database, so I can't use the filename property. I would like to have something like a content property which can be set from code behind.

Any plans on this?

If not, I'm willing to implement it and share...

smartelligence avatar Aug 26 '19 15:08 smartelligence

This is a good idea. Because of the time limitation for the moment we cannot implement new features. It's would be nice if you can do it.

OmidID avatar Aug 27 '19 06:08 OmidID

Actually I found a way to implement it with the current featue set:

  • you need a StringReader X which holds the actual json data then
  • create a Y = new LottieSharp.JsonReader(X)
  • and then call SetAnimationAsync(y, "test")

"test" is any given name for the animation which seems to be needed for caching. The other option, calling SetAnimationAsync(Y) didn't work.

I could only provide my VB# test scripting, I current have no C# example.

smartelligence avatar Aug 27 '19 09:08 smartelligence