@remotion/gif 3.2.31 → 3.2.33
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getGifDurationInSeconds: (src: string) => Promise<number>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getGifDurationInSeconds = void 0;
|
|
4
|
+
const remotion_1 = require("remotion");
|
|
5
|
+
const react_tools_1 = require("./react-tools");
|
|
6
|
+
const getGifDurationInSeconds = async (src) => {
|
|
7
|
+
const resolvedSrc = new URL(src, window.location.origin).href;
|
|
8
|
+
if (remotion_1.Internals.getRemotionEnvironment() === 'rendering') {
|
|
9
|
+
const renderingParsed = (0, react_tools_1.parseWithWorker)(resolvedSrc);
|
|
10
|
+
return ((await renderingParsed.prom).delays.reduce((sum, delay) => sum + delay, 0) / 1000);
|
|
11
|
+
}
|
|
12
|
+
const parsed = await (0, react_tools_1.parseGif)({
|
|
13
|
+
src: resolvedSrc,
|
|
14
|
+
controller: new AbortController(),
|
|
15
|
+
});
|
|
16
|
+
return (parsed.delays.reduce((sum, delay) => sum + delay, 0) / 1000);
|
|
17
|
+
};
|
|
18
|
+
exports.getGifDurationInSeconds = getGifDurationInSeconds;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/gif",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.33",
|
|
4
4
|
"description": "Gif component for remotion",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"repository": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"gifuct-js": "2.1.2",
|
|
25
25
|
"lru_map": "0.4.1",
|
|
26
|
-
"remotion": "3.2.
|
|
26
|
+
"remotion": "3.2.33"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@jonny/eslint-config": "3.0.266",
|
|
@@ -31,7 +31,6 @@
|
|
|
31
31
|
"@types/react": "18.0.1",
|
|
32
32
|
"@types/react-dom": "18.0.0",
|
|
33
33
|
"eslint": "8.13.0",
|
|
34
|
-
"jest": "^27.2.4",
|
|
35
34
|
"prettier": "2.6.2",
|
|
36
35
|
"prettier-plugin-organize-imports": "^2.3.4",
|
|
37
36
|
"react": "18.0.0",
|
|
@@ -54,5 +53,5 @@
|
|
|
54
53
|
"publishConfig": {
|
|
55
54
|
"access": "public"
|
|
56
55
|
},
|
|
57
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "3c864e5ab73870674d028a1199005ddbabaede12"
|
|
58
57
|
}
|