@remotion/lottie 3.2.29 → 3.2.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/Lottie.js +10 -0
  2. package/package.json +3 -3
package/dist/Lottie.js CHANGED
@@ -60,6 +60,7 @@ const Lottie = ({ animationData, className, direction, loop, playbackRate, style
60
60
  }
61
61
  }, [playbackRate]);
62
62
  (0, react_1.useEffect)(() => {
63
+ var _a;
63
64
  if (!animationRef.current) {
64
65
  return;
65
66
  }
@@ -71,6 +72,15 @@ const Lottie = ({ animationData, className, direction, loop, playbackRate, style
71
72
  totalFrames,
72
73
  });
73
74
  animationRef.current.goToAndStop(nextFrame, true);
75
+ const images = (_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.querySelectorAll('image');
76
+ images.forEach((img) => {
77
+ const imgHandle = (0, remotion_1.delayRender)(`Waiting for lottie image with src="${img.href.baseVal}" to load`);
78
+ // https://stackoverflow.com/a/46839799
79
+ img.addEventListener('load', () => {
80
+ (0, remotion_1.continueRender)(imgHandle);
81
+ }, { once: true });
82
+ img.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', img.href.baseVal);
83
+ });
74
84
  }, [direction, frame, loop, playbackRate]);
75
85
  return (0, jsx_runtime_1.jsx)("div", { ref: containerRef, className: className, style: style });
76
86
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/lottie",
3
- "version": "3.2.29",
3
+ "version": "3.2.31",
4
4
  "description": "Remotion Lottie",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -27,7 +27,7 @@
27
27
  ],
28
28
  "license": "SEE LICENSE IN LICENSE.md",
29
29
  "dependencies": {
30
- "remotion": "3.2.29"
30
+ "remotion": "3.2.31"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "lottie-web": "^5",
@@ -58,5 +58,5 @@
58
58
  "publishConfig": {
59
59
  "access": "public"
60
60
  },
61
- "gitHead": "9a2ff4d68324af8d1fe55ebdf94bdadccf446a10"
61
+ "gitHead": "f011b454d78903e548c32f548d8fef642c5ff7a6"
62
62
  }