Skip to content
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

Default Animation Playback Settings Being Incorrectly Added to manifest.json #68

Open
theashraf opened this issue Apr 24, 2024 · 1 comment

Comments

@theashraf
Copy link
Member

When a new animation is added using dotLottie.addAnimation, default playback settings such as loop: false, autoplay: false, and direction: 1 are being incorrectly added to the manifest.json file. These settings should not be added unless explicitly specified by the user.

dotLottie.addAnimation({
       id: "exampleID",
       data: "animationData"
   })

The manifest.json should only contain the fields that are explicitly provided by the user. If no playback settings are specified, they should not be included in the manifest.json.

Current Behavior:
The manifest.json incorrectly includes default playback settings:
loop: false
autoplay: false
direction: 1
...etc

@theashraf
Copy link
Member Author

theashraf commented Apr 24, 2024

KGyU9zyZPt.zip
The attached zip file contains the actual manifest.json:

{
  "animations": [
    {
      "id": "af1f6db8-c933-4e72-a965-553cc44d8976",
      "mode": "normal",
      "direction": 1
    }
  ],
  "author": "LottieFiles",
  "description": "",
  "generator": "dotLottie-js",
  "keywords": "",
  "version": "1.0"
}

However, when this dotLottie file is imported using the fromArrayBuffer() method, the manifest does not match the original:

{
  "version": "1.0",
  "revision": 1,
  "keywords": "dotLottie",
  "author": "LottieFiles",
  "generator": "dotLottie-js",
  "animations": [
    {
      "id": "af1f6db8-c933-4e72-a965-553cc44d8976",
      "direction": 1,
      "speed": 1,
      "playMode": "normal",
      "loop": false,
      "autoplay": false,
      "hover": false,
      "intermission": 0
    }
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant