I attempted to use reflection to invoke the private Start and Stop methods in Lottie.cs. While this approach works in certain scenarios, some specific Lottie files exhibit issues where the animation continues to play indefinitely, even after invoking Stop. It seems that these problematic files also render the RepeatCount property ineffective, as the property value does not appear to influence the playback behavior.
private void ChangeLottieStatus(bool animating)
{
var lottie = LottieLoading;
var type = lottie.GetType();
var methodName = animating ? "Start" : "Stop";
var methodInfo = type.GetMethod(methodName, BindingFlags.NonPublic | BindingFlags.Instance);
if (methodInfo != null)
{
methodInfo.Invoke(lottie, null);
}
else
{
Console.WriteLine($"Method '{methodName}' Not Found.");
}
}
I attempted to use reflection to invoke the private
Start
andStop
methods inLottie.cs
. While this approach works in certain scenarios, some specific Lottie files exhibit issues where the animation continues to play indefinitely, even after invokingStop
. It seems that these problematic files also render theRepeatCount
property ineffective, as the property value does not appear to influence the playback behavior.Thanks!