-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
guard self.window != nil prevents layer animation from playing #999
Comments
I spent days trying to export CALayer without real UIView rendered on the screen (through AVMutableVideoComposition and AVAssetExportSession) and I got the same results. This line really ruin the coolest way to export animations. |
I am also seeing this issue... even when adding an |
I had this issue, and I resolved it by moving the initialisation of |
Using version 3.1.5 and came across this issue. Edit: updated to 3.3.0 and issue persists. |
Closing since I don't think this is a supported way to use a |
This issue is a:
Which Version of Lottie are you using?
Lottie 3.1.2
What Platform are you on?
What Language are you in?
Expected Behavior
Actual Behavior
Code Example
Adding an AnimationView's layer to another CALayer, the animation will never play because of this line in AnimationView.swift:
guard self.window != nil else { waitingToPlayAimation = true; return }
If I comment that out, it works as expected. The reason is that I am not adding the AnimationView to the view hierarchy, and therefore its window is nil. Layer does not have a window property.
works:
view.addSubview(lottieView)
does not work:
customLayer.addSublayer(lottieView.layer)
I think I understand the purpose of that line, you don't want it playing if it isn't on the screen, but maybe an option could be added for layer animations to bypass that?
The text was updated successfully, but these errors were encountered: