mifi / react-lottie-player

Fully declarative React Lottie player
MIT License
494 stars 52 forks source link

[Feature Request] Ability to configure quality #99

Closed TheCatLady closed 1 year ago

TheCatLady commented 1 year ago

Would be great to support configuration of the lottie player quality for improved performance. 😺

https://github.com/airbnb/lottie-web/wiki/Usage#global-methods

lottie.setQuality() -- default 'high', set 'high','medium','low', or a number > 1 to improve player performance. In some animations as low as 2 won't show any difference.

mifi commented 1 year ago

hmm, it seems to be a global method, so it seems a bit wrong to be able to allow setting it on a react element

TheCatLady commented 1 year ago

Hm, that is very true...

Can you provide any guidance on the recommended way to configure this setting when using this component? 🤔

mifi commented 1 year ago

I think just call this function on lottie-web directly, something like

import lottie from 'lottie-web'

lottie.setQuality(123)
TheCatLady commented 1 year ago

@mifi Thanks! That's consistent with what I implemented on our site. Appreciate your reply, closing this now. 😄