-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
How to pre-fetch/pre-load or showing loading spinner for Lotties from remote URI? #943
Comments
There is no plan for that right now. But that's can be a good addition for future implementations. |
+1 |
@matinzd Is there any way to show a loading spinner while the lottie is fetching remotely?? |
I have managed to get this working using I simply use the Similarly, if someone wanted to build their own solution they could simply fetch the data in advance using I am sure there could be a significantly better implementation if done within the package since the default |
+1 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information. |
I am not promising anything, but maybe after we wrap up bridgeless, we can come back and take a crack at this. I feel like this could be a nice little API. CC: @matinzd |
@TheRogue76 What steps would you take? I'm happy to take a crack at it. |
@ansh I'd go with the Event callbacks for now, and not bother making it too complicated out of the gate with the prefetch stuff (because you would have to keep the prefetched stuff somewhere, and that is a whole can of worms, from the API design, to where it would be stored, to cache invalidation, to disk and memory management etc. It needs to be thought out A LOT, so not now). We already have an event called We have to think about where it would make sense to call this API (technically loading dotLottie and even the JSON animations take a bit of time, but do we add them or not? etc) and then it is just a matter of doing it for our supported platforms. |
I'd start with seeing what the |
Description
I want to pre-fetch/pre-load remote URI's so that when I am displaying a Lottie, it is instant. However, right now my component takes a second or two after mounted to fetch the Lottie from the remote URI.
The native
<Image />
component from React Native has adefaultSource
and alsoonLoadStart
andonLoadEnd
components that allow to show loading spinners while the image is fetching. Furthermore, it also has theprefetch()
function that allows for pre-fetching.How can I do either show a loading spinner or pre-fetch/pre-load remote Lottie URI's?
The text was updated successfully, but these errors were encountered: