@remotion/player 4.0.277 → 4.0.279
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.
- package/dist/cjs/use-player.js +12 -4
- package/dist/esm/index.mjs +12 -4
- package/package.json +3 -3
package/dist/cjs/use-player.js
CHANGED
|
@@ -101,10 +101,14 @@ const usePlayer = () => {
|
|
|
101
101
|
}
|
|
102
102
|
setFrame((c) => {
|
|
103
103
|
var _a, _b;
|
|
104
|
-
const
|
|
104
|
+
const prevFrame = (_b = (_a = c[videoId]) !== null && _a !== void 0 ? _a : window.remotion_initialFrame) !== null && _b !== void 0 ? _b : 0;
|
|
105
|
+
const newFrame = Math.max(0, prevFrame - frames);
|
|
106
|
+
if (prevFrame === newFrame) {
|
|
107
|
+
return c;
|
|
108
|
+
}
|
|
105
109
|
return {
|
|
106
110
|
...c,
|
|
107
|
-
[videoId]:
|
|
111
|
+
[videoId]: newFrame,
|
|
108
112
|
};
|
|
109
113
|
});
|
|
110
114
|
}, [imperativePlaying, setFrame, videoId]);
|
|
@@ -117,10 +121,14 @@ const usePlayer = () => {
|
|
|
117
121
|
}
|
|
118
122
|
setFrame((c) => {
|
|
119
123
|
var _a, _b;
|
|
120
|
-
const
|
|
124
|
+
const prevFrame = (_b = (_a = c[videoId]) !== null && _a !== void 0 ? _a : window.remotion_initialFrame) !== null && _b !== void 0 ? _b : 0;
|
|
125
|
+
const newFrame = Math.min(lastFrame, prevFrame + frames);
|
|
126
|
+
if (prevFrame === newFrame) {
|
|
127
|
+
return c;
|
|
128
|
+
}
|
|
121
129
|
return {
|
|
122
130
|
...c,
|
|
123
|
-
[videoId]:
|
|
131
|
+
[videoId]: newFrame,
|
|
124
132
|
};
|
|
125
133
|
});
|
|
126
134
|
}, [videoId, imperativePlaying, lastFrame, setFrame]);
|
package/dist/esm/index.mjs
CHANGED
|
@@ -629,10 +629,14 @@ var usePlayer = () => {
|
|
|
629
629
|
return;
|
|
630
630
|
}
|
|
631
631
|
setFrame((c) => {
|
|
632
|
-
const
|
|
632
|
+
const prevFrame = c[videoId] ?? window.remotion_initialFrame ?? 0;
|
|
633
|
+
const newFrame = Math.max(0, prevFrame - frames);
|
|
634
|
+
if (prevFrame === newFrame) {
|
|
635
|
+
return c;
|
|
636
|
+
}
|
|
633
637
|
return {
|
|
634
638
|
...c,
|
|
635
|
-
[videoId]:
|
|
639
|
+
[videoId]: newFrame
|
|
636
640
|
};
|
|
637
641
|
});
|
|
638
642
|
}, [imperativePlaying, setFrame, videoId]);
|
|
@@ -644,10 +648,14 @@ var usePlayer = () => {
|
|
|
644
648
|
return;
|
|
645
649
|
}
|
|
646
650
|
setFrame((c) => {
|
|
647
|
-
const
|
|
651
|
+
const prevFrame = c[videoId] ?? window.remotion_initialFrame ?? 0;
|
|
652
|
+
const newFrame = Math.min(lastFrame, prevFrame + frames);
|
|
653
|
+
if (prevFrame === newFrame) {
|
|
654
|
+
return c;
|
|
655
|
+
}
|
|
648
656
|
return {
|
|
649
657
|
...c,
|
|
650
|
-
[videoId]:
|
|
658
|
+
[videoId]: newFrame
|
|
651
659
|
};
|
|
652
660
|
});
|
|
653
661
|
}, [videoId, imperativePlaying, lastFrame, setFrame]);
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/player"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/player",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.279",
|
|
7
7
|
"description": "React component for embedding a Remotion preview into your app",
|
|
8
8
|
"main": "dist/cjs/index.js",
|
|
9
9
|
"types": "dist/cjs/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
],
|
|
29
29
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"remotion": "4.0.
|
|
31
|
+
"remotion": "4.0.279"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"react": ">=16.8.0",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"webpack": "5.96.1",
|
|
44
44
|
"zod": "3.22.3",
|
|
45
45
|
"eslint": "9.19.0",
|
|
46
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
46
|
+
"@remotion/eslint-config-internal": "4.0.279"
|
|
47
47
|
},
|
|
48
48
|
"keywords": [
|
|
49
49
|
"remotion",
|