aspnetcore icon indicating copy to clipboard operation
aspnetcore copied to clipboard

Using Lottie in Blazor

Open Laftek opened this issue 3 years ago • 3 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Describe the bug

I am trying to use Lottie in Blazor and it should be straightforward but I guess I am doing something wrong.

I followed this: https://lottiefiles.com/blog/working-with-lottie/how-to-add-lottie-animation-in-web-page-html/

Using in _Layout throws error because of "@" character -> I put one more to escape it -> but result is empty lottie player with yellow warning triangle instead of animation.

I thought its maybe because of double @ character so I just copied whole script locally to scripts.js and import it in _Layout but the same result -> empty lottie player with yellow warning triangle instead of animation.

Is there any known workaround or guide what should I do?

Expected Behavior

To display lottie animation.

Steps To Reproduce

Create blazor project and folow https://lottiefiles.com/blog/working-with-lottie/how-to-add-lottie-animation-in-web-page-html/

Exceptions (if any)

No response

.NET Version

7.0.100-rc.1.22431.12

Anything else?

No response

Laftek avatar Sep 21 '22 15:09 Laftek

Hey @Laftek, thanks for reaching out. Are you seeing any errors in the developer tools console?

TanayParikh avatar Sep 21 '22 16:09 TanayParikh

Hi @Laftek. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

ghost avatar Sep 21 '22 16:09 ghost

Hi! It worked for me with the double @. Probably is a problem with your animation's JSON.

image

image

image

migueln1 avatar Sep 22 '22 04:09 migueln1

You are right, I messed up 2 characters in the link. Now its working! Thank you! Also its working with WASM/MAUI (dont forget to call script OnAfterRenderAsync)

Laftek avatar Sep 23 '22 14:09 Laftek