Baseflow / LottieXamarin

Render After Effects animations natively on Android, iOS, MacOS and TvOS for Xamarin
https://baseflow.com
Apache License 2.0
1.22k stars 261 forks source link

Lottie files with text don't play on Xamarin.iOS #306

Open paulmckee opened 3 years ago

paulmckee commented 3 years ago

🐛 Bug Report

Some valid Lottie animations don't play back at all in LOTAnimationView on Xamarin.iOS. Based on limited data, it appears to be those that contain text.

Here is an example of a file that doesn't play back. This was exported from After Effects: tap-a-topic-EN.json.txt (File renamed with .txt extension to allow it to be attached here.)
For this file, the animator created a text string and animated it to give a throbbing effect every 6 seconds. This file plays fine in other contexts like, for example, this previewer.

By contrast, here is another file that was also exported from After Effects. This one should look exactly the same as the one above, but in this case the animator converted the text to vector shapes. This file plays back perfectly using LottieXamarin: tap-a-topic-EN-shape-layer.json.txt

Note: I see that the readme has a list of Supported After Effects Features, and I don't see anything there about text. Is it possible that text in Lottie files is just not supported?

Expected behavior

Any value Lottie file should be played back correctly.

Reproduction steps

  1. Create a Xamarin.iOS project for iPad in VS 2019
  2. Use NuGet to add Com.Airbnb.iOS.Lottie
  3. In a view controller, instantiate a LOTAnimationView, load the Lottie file, and add it to the visual tree. I used the following code
                LOTAnimationView animation = LOTAnimationView.AnimationWithFilePath(pathToLottieAnimation);
                animation.Frame = new CGRect(0, 0, 610, 50);
                animation.ContentMode = UIViewContentMode.ScaleAspectFit;
                animation.LoopAnimation = true;
                container.AddSubview(animation);
                animation.Play();
  4. Run the application
  5. Look at the screen

Configuration

Version: Com.Airbnb.iOS.Lottie 2.5.13

Platform:

dlaundavgn commented 3 years ago

Is this something that will be prioritized to be fixed? Have you heard anything back, @paulmckee?

paulmckee commented 2 years ago

Have you heard anything back, @paulmckee?

Nope, @dlaundavgn, I never have.