Coder Social home page Coder Social logo

Comments (5)

mime29 avatar mime29 commented on June 13, 2024 1

I identified the same problem here as well. With dotLottie files only. JSON files are working fine.
Even If I set the loopMode on the view right after building it I can observe:

  • If I set the loopMode before setting up the animationLoaded block, the .loop mode is ignored.
  • As indicated by @SaladDays831, If I set the loopMode = .loop inside the animationLoaded, right before the play(), it works. The animation loops.

from lottie-ios.

calda avatar calda commented on June 13, 2024

Can you share the animation file itself here? I can't open the lottiefile.com link:
image

from lottie-ios.

SaladDays831 avatar SaladDays831 commented on June 13, 2024

Oh, sorry @calda, thought it was a public animation

LottieLego.zip

from lottie-ios.

calda avatar calda commented on June 13, 2024

I believe this is the expected behavior of a dotLottie animation, since the json manifest includes configuration on the loop mode to use, which we apply to the LottieAnimationView when loading the animation.

@mime29's solution is a good suggestion -- if you modify the loopMode in animationLoaded, that will override whatever was specified by the DotLottie animation.

We've improved this in the SwiftUI LottieView by not applying the dotLottie loop mode by default, and instead making that behavior opt-in: #2277.

from lottie-ios.

mime29 avatar mime29 commented on June 13, 2024

I believe this is the expected behavior of a dotLottie animation, since the json manifest includes configuration on the loop mode to use, which we apply to the LottieAnimationView when loading the animation.

@mime29's solution is a good suggestion -- if you modify the loopMode in animationLoaded, that will override whatever was specified by the DotLottie animation.

We've improved this in the SwiftUI LottieView by not applying the dotLottie loop mode by default, and instead making that behavior opt-in: #2277.

@calda , I guess you meant: "since the dotLottie manifest includes configuration on the loop mode to use" ?
Is there a link to this spec? I could not find it but I'd like to forward this info to designers so that they understand better the control they have over the animation.

from lottie-ios.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.