@remotion/player 4.0.472 → 4.0.474

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.
@@ -32,12 +32,15 @@ const usePlayer = () => {
32
32
  }
33
33
  const { buffering } = bufferingContext;
34
34
  const seek = (0, react_1.useCallback)((newFrame) => {
35
+ const frameToSeekTo = config
36
+ ? remotion_1.Internals.TimelinePosition.clampFrameToCompositionRange(newFrame, config.durationInFrames)
37
+ : Math.max(0, newFrame);
35
38
  if (video === null || video === void 0 ? void 0 : video.id) {
36
- setTimelinePosition((c) => ({ ...c, [video.id]: newFrame }));
39
+ setTimelinePosition((c) => ({ ...c, [video.id]: frameToSeekTo }));
37
40
  }
38
- frameRef.current = newFrame;
39
- emitter.dispatchSeek(newFrame);
40
- }, [emitter, setTimelinePosition, video === null || video === void 0 ? void 0 : video.id]);
41
+ frameRef.current = frameToSeekTo;
42
+ emitter.dispatchSeek(frameToSeekTo);
43
+ }, [config, emitter, setTimelinePosition, video === null || video === void 0 ? void 0 : video.id]);
41
44
  const play = (0, react_1.useCallback)((e) => {
42
45
  if (imperativePlaying.current) {
43
46
  return;
@@ -594,12 +594,13 @@ var usePlayer = () => {
594
594
  }
595
595
  const { buffering } = bufferingContext;
596
596
  const seek = useCallback((newFrame) => {
597
+ const frameToSeekTo = config ? Internals4.TimelinePosition.clampFrameToCompositionRange(newFrame, config.durationInFrames) : Math.max(0, newFrame);
597
598
  if (video?.id) {
598
- setTimelinePosition((c) => ({ ...c, [video.id]: newFrame }));
599
+ setTimelinePosition((c) => ({ ...c, [video.id]: frameToSeekTo }));
599
600
  }
600
- frameRef.current = newFrame;
601
- emitter.dispatchSeek(newFrame);
602
- }, [emitter, setTimelinePosition, video?.id]);
601
+ frameRef.current = frameToSeekTo;
602
+ emitter.dispatchSeek(frameToSeekTo);
603
+ }, [config, emitter, setTimelinePosition, video?.id]);
603
604
  const play = useCallback((e) => {
604
605
  if (imperativePlaying.current) {
605
606
  return;
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.472",
6
+ "version": "4.0.474",
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",
@@ -35,7 +35,7 @@
35
35
  ],
36
36
  "license": "SEE LICENSE IN LICENSE.md",
37
37
  "dependencies": {
38
- "remotion": "4.0.472"
38
+ "remotion": "4.0.474"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "react": ">=16.8.0",
@@ -49,7 +49,7 @@
49
49
  "react-dom": "19.2.3",
50
50
  "webpack": "5.105.0",
51
51
  "zod": "4.3.6",
52
- "@remotion/eslint-config-internal": "4.0.472",
52
+ "@remotion/eslint-config-internal": "4.0.474",
53
53
  "eslint": "9.19.0",
54
54
  "@typescript/native-preview": "7.0.0-dev.20260217.1"
55
55
  },