remotion 4.0.116 → 4.0.118

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.
@@ -5,6 +5,6 @@ const getAbsoluteSrc = (relativeSrc) => {
5
5
  if (typeof window === 'undefined') {
6
6
  return relativeSrc;
7
7
  }
8
- return new URL(relativeSrc, window.location.origin).href;
8
+ return new URL(relativeSrc, window.origin).href;
9
9
  };
10
10
  exports.getAbsoluteSrc = getAbsoluteSrc;
@@ -62,7 +62,7 @@ const AudioRefForwardingFunction = (props, ref) => {
62
62
  (0, validate_start_from_props_js_1.validateStartFromProps)(startFrom, endAt);
63
63
  const startFromFrameNo = startFrom !== null && startFrom !== void 0 ? startFrom : 0;
64
64
  const endAtFrameNo = endAt !== null && endAt !== void 0 ? endAt : Infinity;
65
- return ((0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, name: name, children: (0, jsx_runtime_1.jsx)(exports.Audio, { _remotionInternalNeedsDurationCalculation: Boolean(loop), ...otherProps, ref: ref }) }));
65
+ return ((0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, name: name, children: (0, jsx_runtime_1.jsx)(exports.Audio, { _remotionInternalNeedsDurationCalculation: Boolean(loop), pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, ...otherProps, ref: ref }) }));
66
66
  }
67
67
  (0, validate_media_props_js_1.validateMediaProps)(props, 'Audio');
68
68
  if (environment.isRendering) {
@@ -51,8 +51,8 @@ const didPropChange = (key, newProp, prevProp) => {
51
51
  if (key === 'src' &&
52
52
  !prevProp.startsWith('data:') &&
53
53
  !newProp.startsWith('data:')) {
54
- return (new URL(prevProp, window.location.origin).toString() !==
55
- new URL(newProp, window.location.origin).toString());
54
+ return (new URL(prevProp, window.origin).toString() !==
55
+ new URL(newProp, window.origin).toString());
56
56
  }
57
57
  if (prevProp === newProp) {
58
58
  return false;
@@ -29,10 +29,11 @@ export declare const NoReactInternals: {
29
29
  bundleMapName: string;
30
30
  deserializeJSONWithCustomFields: (data: string) => Record<string, unknown>;
31
31
  DELAY_RENDER_CALLSTACK_TOKEN: string;
32
- getOffthreadVideoSource: ({ src, transparent, currentTime, }: {
32
+ getOffthreadVideoSource: ({ src, transparent, currentTime, toneMapped, }: {
33
33
  src: string;
34
34
  transparent: boolean;
35
35
  currentTime: number;
36
+ toneMapped: boolean;
36
37
  }) => string;
37
38
  getExpectedMediaFrameUncorrected: ({ frame, playbackRate, startFrom, }: {
38
39
  frame: number;
@@ -1 +1 @@
1
- export declare const VERSION = "4.0.116";
1
+ export declare const VERSION = "4.0.118";
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
4
  // Automatically generated on publish
5
- exports.VERSION = '4.0.116';
5
+ exports.VERSION = '4.0.118';
@@ -29,13 +29,13 @@ const OffthreadVideo = (props) => {
29
29
  (0, validate_start_from_props_js_1.validateStartFromProps)(startFrom, endAt);
30
30
  const startFromFrameNo = startFrom !== null && startFrom !== void 0 ? startFrom : 0;
31
31
  const endAtFrameNo = endAt !== null && endAt !== void 0 ? endAt : Infinity;
32
- return ((0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, name: name, children: (0, jsx_runtime_1.jsx)(exports.OffthreadVideo, { ...otherProps }) }));
32
+ return ((0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, name: name, children: (0, jsx_runtime_1.jsx)(exports.OffthreadVideo, { pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, ...otherProps }) }));
33
33
  }
34
34
  (0, validate_media_props_js_1.validateMediaProps)(props, 'Video');
35
35
  if (environment.isRendering) {
36
36
  return (0, jsx_runtime_1.jsx)(OffthreadVideoForRendering_js_1.OffthreadVideoForRendering, { ...otherProps });
37
37
  }
38
- const { transparent, ...withoutTransparent } = otherProps;
38
+ const { transparent, toneMapped, ...withoutTransparent } = otherProps;
39
39
  return ((0, jsx_runtime_1.jsx)(VideoForPreview_js_1.VideoForPreview, { _remotionInternalStack: stack !== null && stack !== void 0 ? stack : null, _remotionInternalNativeLoopPassed: false, onDuration: onDuration, onlyWarnForMediaSeekingError: true, pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, ...withoutTransparent }));
40
40
  };
41
41
  exports.OffthreadVideo = OffthreadVideo;
@@ -18,7 +18,7 @@ const use_unsafe_video_config_js_1 = require("../use-unsafe-video-config.js");
18
18
  const volume_prop_js_1 = require("../volume-prop.js");
19
19
  const get_current_time_js_1 = require("./get-current-time.js");
20
20
  const offthread_video_source_js_1 = require("./offthread-video-source.js");
21
- const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate, src, muted, allowAmplificationDuringRender, transparent = false, toneFrequency, name, ...props }) => {
21
+ const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate, src, muted, allowAmplificationDuringRender, transparent = false, toneMapped = true, toneFrequency, name, ...props }) => {
22
22
  const absoluteFrame = (0, timeline_position_state_js_1.useTimelinePosition)();
23
23
  const frame = (0, use_current_frame_js_1.useCurrentFrame)();
24
24
  const volumePropsFrame = (0, use_audio_frame_js_1.useFrameForVolumeProp)();
@@ -92,8 +92,13 @@ const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate,
92
92
  }) / videoConfig.fps);
93
93
  }, [frame, mediaStartsAt, playbackRate, videoConfig.fps]);
94
94
  const actualSrc = (0, react_1.useMemo)(() => {
95
- return (0, offthread_video_source_js_1.getOffthreadVideoSource)({ src, currentTime, transparent });
96
- }, [currentTime, src, transparent]);
95
+ return (0, offthread_video_source_js_1.getOffthreadVideoSource)({
96
+ src,
97
+ currentTime,
98
+ transparent,
99
+ toneMapped,
100
+ });
101
+ }, [toneMapped, currentTime, src, transparent]);
97
102
  const onErr = (0, react_1.useCallback)((e) => {
98
103
  if (onError) {
99
104
  onError === null || onError === void 0 ? void 0 : onError(e);
@@ -48,7 +48,7 @@ const VideoForwardingFunction = (props, ref) => {
48
48
  (0, validate_start_from_props_js_1.validateStartFromProps)(startFrom, endAt);
49
49
  const startFromFrameNo = startFrom !== null && startFrom !== void 0 ? startFrom : 0;
50
50
  const endAtFrameNo = endAt !== null && endAt !== void 0 ? endAt : Infinity;
51
- return ((0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, name: name, children: (0, jsx_runtime_1.jsx)(exports.Video, { ...otherProps, ref: ref }) }));
51
+ return ((0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, name: name, children: (0, jsx_runtime_1.jsx)(exports.Video, { pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, ...otherProps, ref: ref }) }));
52
52
  }
53
53
  (0, validate_media_props_js_1.validateMediaProps)(props, 'Video');
54
54
  if (environment.isRendering) {
@@ -1,5 +1,6 @@
1
- export declare const getOffthreadVideoSource: ({ src, transparent, currentTime, }: {
1
+ export declare const getOffthreadVideoSource: ({ src, transparent, currentTime, toneMapped, }: {
2
2
  src: string;
3
3
  transparent: boolean;
4
4
  currentTime: number;
5
+ toneMapped: boolean;
5
6
  }) => string;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getOffthreadVideoSource = void 0;
4
4
  const absolute_src_1 = require("../absolute-src");
5
- const getOffthreadVideoSource = ({ src, transparent, currentTime, }) => {
6
- return `http://localhost:${window.remotion_proxyPort}/proxy?src=${encodeURIComponent((0, absolute_src_1.getAbsoluteSrc)(src))}&time=${encodeURIComponent(currentTime)}&transparent=${String(transparent)}`;
5
+ const getOffthreadVideoSource = ({ src, transparent, currentTime, toneMapped, }) => {
6
+ return `http://localhost:${window.remotion_proxyPort}/proxy?src=${encodeURIComponent((0, absolute_src_1.getAbsoluteSrc)(src))}&time=${encodeURIComponent(currentTime)}&transparent=${String(transparent)}&toneMapped=${String(toneMapped)}`;
7
7
  };
8
8
  exports.getOffthreadVideoSource = getOffthreadVideoSource;
@@ -37,6 +37,7 @@ export type OffthreadVideoProps = {
37
37
  allowAmplificationDuringRender?: boolean;
38
38
  toneFrequency?: number;
39
39
  transparent?: boolean;
40
+ toneMapped?: boolean;
40
41
  pauseWhenBuffering?: boolean;
41
42
  /**
42
43
  * @deprecated For internal use only
@@ -105,7 +105,7 @@ function truthy(value) {
105
105
  }
106
106
 
107
107
  // Automatically generated on publish
108
- const VERSION = '4.0.116';
108
+ const VERSION = '4.0.118';
109
109
 
110
110
  const checkMultipleRemotionVersions = () => {
111
111
  if (typeof globalThis === 'undefined') {
@@ -1084,7 +1084,7 @@ const getAbsoluteSrc = (relativeSrc) => {
1084
1084
  if (typeof window === 'undefined') {
1085
1085
  return relativeSrc;
1086
1086
  }
1087
- return new URL(relativeSrc, window.location.origin).href;
1087
+ return new URL(relativeSrc, window.origin).href;
1088
1088
  };
1089
1089
 
1090
1090
  const calculateLoopDuration = ({ endAt, mediaDuration, playbackRate, startFrom, }) => {
@@ -2225,8 +2225,8 @@ const didPropChange = (key, newProp, prevProp) => {
2225
2225
  if (key === 'src' &&
2226
2226
  !prevProp.startsWith('data:') &&
2227
2227
  !newProp.startsWith('data:')) {
2228
- return (new URL(prevProp, window.location.origin).toString() !==
2229
- new URL(newProp, window.location.origin).toString());
2228
+ return (new URL(prevProp, window.origin).toString() !==
2229
+ new URL(newProp, window.origin).toString());
2230
2230
  }
2231
2231
  if (prevProp === newProp) {
2232
2232
  return false;
@@ -2786,7 +2786,7 @@ const AudioRefForwardingFunction = (props, ref) => {
2786
2786
  validateStartFromProps(startFrom, endAt);
2787
2787
  const startFromFrameNo = startFrom !== null && startFrom !== void 0 ? startFrom : 0;
2788
2788
  const endAtFrameNo = endAt !== null && endAt !== void 0 ? endAt : Infinity;
2789
- return (jsx(Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, name: name, children: jsx(Audio, { _remotionInternalNeedsDurationCalculation: Boolean(loop), ...otherProps, ref: ref }) }));
2789
+ return (jsx(Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, name: name, children: jsx(Audio, { _remotionInternalNeedsDurationCalculation: Boolean(loop), pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, ...otherProps, ref: ref }) }));
2790
2790
  }
2791
2791
  validateMediaProps(props, 'Audio');
2792
2792
  if (environment.isRendering) {
@@ -4308,8 +4308,8 @@ const validateFrame = ({ allowFloats, durationInFrames, frame, }) => {
4308
4308
  }
4309
4309
  };
4310
4310
 
4311
- const getOffthreadVideoSource = ({ src, transparent, currentTime, }) => {
4312
- return `http://localhost:${window.remotion_proxyPort}/proxy?src=${encodeURIComponent(getAbsoluteSrc(src))}&time=${encodeURIComponent(currentTime)}&transparent=${String(transparent)}`;
4311
+ const getOffthreadVideoSource = ({ src, transparent, currentTime, toneMapped, }) => {
4312
+ return `http://localhost:${window.remotion_proxyPort}/proxy?src=${encodeURIComponent(getAbsoluteSrc(src))}&time=${encodeURIComponent(currentTime)}&transparent=${String(transparent)}&toneMapped=${String(toneMapped)}`;
4313
4313
  };
4314
4314
 
4315
4315
  const flattenChildren = (children) => {
@@ -4665,7 +4665,7 @@ const Still = (props) => {
4665
4665
  return React.createElement((Composition), newProps);
4666
4666
  };
4667
4667
 
4668
- const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate, src, muted, allowAmplificationDuringRender, transparent = false, toneFrequency, name, ...props }) => {
4668
+ const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate, src, muted, allowAmplificationDuringRender, transparent = false, toneMapped = true, toneFrequency, name, ...props }) => {
4669
4669
  const absoluteFrame = useTimelinePosition();
4670
4670
  const frame = useCurrentFrame();
4671
4671
  const volumePropsFrame = useFrameForVolumeProp();
@@ -4739,8 +4739,13 @@ const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate,
4739
4739
  }) / videoConfig.fps);
4740
4740
  }, [frame, mediaStartsAt, playbackRate, videoConfig.fps]);
4741
4741
  const actualSrc = useMemo(() => {
4742
- return getOffthreadVideoSource({ src, currentTime, transparent });
4743
- }, [currentTime, src, transparent]);
4742
+ return getOffthreadVideoSource({
4743
+ src,
4744
+ currentTime,
4745
+ transparent,
4746
+ toneMapped,
4747
+ });
4748
+ }, [toneMapped, currentTime, src, transparent]);
4744
4749
  const onErr = useCallback((e) => {
4745
4750
  if (onError) {
4746
4751
  onError === null || onError === void 0 ? void 0 : onError(e);
@@ -4911,13 +4916,13 @@ const OffthreadVideo = (props) => {
4911
4916
  validateStartFromProps(startFrom, endAt);
4912
4917
  const startFromFrameNo = startFrom !== null && startFrom !== void 0 ? startFrom : 0;
4913
4918
  const endAtFrameNo = endAt !== null && endAt !== void 0 ? endAt : Infinity;
4914
- return (jsx(Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, name: name, children: jsx(OffthreadVideo, { ...otherProps }) }));
4919
+ return (jsx(Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, name: name, children: jsx(OffthreadVideo, { pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, ...otherProps }) }));
4915
4920
  }
4916
4921
  validateMediaProps(props, 'Video');
4917
4922
  if (environment.isRendering) {
4918
4923
  return jsx(OffthreadVideoForRendering, { ...otherProps });
4919
4924
  }
4920
- const { transparent, ...withoutTransparent } = otherProps;
4925
+ const { transparent, toneMapped, ...withoutTransparent } = otherProps;
4921
4926
  return (jsx(VideoForPreview, { _remotionInternalStack: stack !== null && stack !== void 0 ? stack : null, _remotionInternalNativeLoopPassed: false, onDuration: onDuration, onlyWarnForMediaSeekingError: true, pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, ...withoutTransparent }));
4922
4927
  };
4923
4928
 
@@ -5218,7 +5223,7 @@ const VideoForwardingFunction = (props, ref) => {
5218
5223
  validateStartFromProps(startFrom, endAt);
5219
5224
  const startFromFrameNo = startFrom !== null && startFrom !== void 0 ? startFrom : 0;
5220
5225
  const endAtFrameNo = endAt !== null && endAt !== void 0 ? endAt : Infinity;
5221
- return (jsx(Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, name: name, children: jsx(Video, { ...otherProps, ref: ref }) }));
5226
+ return (jsx(Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, name: name, children: jsx(Video, { pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, ...otherProps, ref: ref }) }));
5222
5227
  }
5223
5228
  validateMediaProps(props, 'Video');
5224
5229
  if (environment.isRendering) {
@@ -740,11 +740,11 @@ const getAbsoluteSrc = (relativeSrc) => {
740
740
  if (typeof window === 'undefined') {
741
741
  return relativeSrc;
742
742
  }
743
- return new URL(relativeSrc, window.location.origin).href;
743
+ return new URL(relativeSrc, window.origin).href;
744
744
  };
745
745
 
746
- const getOffthreadVideoSource = ({ src, transparent, currentTime, }) => {
747
- return `http://localhost:${window.remotion_proxyPort}/proxy?src=${encodeURIComponent(getAbsoluteSrc(src))}&time=${encodeURIComponent(currentTime)}&transparent=${String(transparent)}`;
746
+ const getOffthreadVideoSource = ({ src, transparent, currentTime, toneMapped, }) => {
747
+ return `http://localhost:${window.remotion_proxyPort}/proxy?src=${encodeURIComponent(getAbsoluteSrc(src))}&time=${encodeURIComponent(currentTime)}&transparent=${String(transparent)}&toneMapped=${String(toneMapped)}`;
748
748
  };
749
749
 
750
750
  const NoReactInternals = {
@@ -1,4 +1,4 @@
1
1
  // Automatically generated on publish
2
- const VERSION = '4.0.116';
2
+ const VERSION = '4.0.118';
3
3
 
4
4
  export { VERSION };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remotion",
3
- "version": "4.0.116",
3
+ "version": "4.0.118",
4
4
  "description": "Render videos in React",
5
5
  "main": "dist/cjs/index.js",
6
6
  "types": "dist/cjs/index.d.ts",