remotion 4.0.496 → 4.0.498

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 (49) hide show
  1. package/dist/cjs/HtmlInCanvas.d.ts +35 -0
  2. package/dist/cjs/HtmlInCanvas.js +2 -0
  3. package/dist/cjs/Img.d.ts +55 -3
  4. package/dist/cjs/Img.js +22 -5
  5. package/dist/cjs/Interactive.d.ts +74 -6
  6. package/dist/cjs/Interactive.js +17 -2
  7. package/dist/cjs/animated-image/AnimatedImage.d.ts +135 -1
  8. package/dist/cjs/animated-image/AnimatedImage.js +47 -9
  9. package/dist/cjs/animated-image/create-image-decoder.d.ts +9 -0
  10. package/dist/cjs/animated-image/create-image-decoder.js +26 -0
  11. package/dist/cjs/animated-image/decode-image.d.ts +1 -0
  12. package/dist/cjs/animated-image/decode-image.js +14 -16
  13. package/dist/cjs/animated-image/get-duration-in-seconds.d.ts +6 -0
  14. package/dist/cjs/animated-image/get-duration-in-seconds.js +31 -0
  15. package/dist/cjs/animated-image/props.d.ts +2 -2
  16. package/dist/cjs/audio/html5-audio.js +4 -4
  17. package/dist/cjs/audio/shared-audio-tags.js +18 -16
  18. package/dist/cjs/audio/shared-element-source-node.d.ts +2 -1
  19. package/dist/cjs/audio/shared-element-source-node.js +6 -2
  20. package/dist/cjs/canvas-image/CanvasImage.d.ts +53 -1
  21. package/dist/cjs/canvas-image/CanvasImage.js +17 -2
  22. package/dist/cjs/canvas-image/props.d.ts +2 -2
  23. package/dist/cjs/effects/Solid.d.ts +35 -0
  24. package/dist/cjs/effects/Solid.js +2 -0
  25. package/dist/cjs/interactivity-schema.d.ts +144 -32
  26. package/dist/cjs/interactivity-schema.js +44 -10
  27. package/dist/cjs/internals.d.ts +77 -26
  28. package/dist/cjs/internals.js +2 -1
  29. package/dist/cjs/no-react.d.ts +36 -6
  30. package/dist/cjs/no-react.js +2 -1
  31. package/dist/cjs/series/index.d.ts +1 -1
  32. package/dist/cjs/series/index.js +1 -0
  33. package/dist/cjs/use-amplification.d.ts +1 -0
  34. package/dist/cjs/v5-flag.d.ts +1 -0
  35. package/dist/cjs/v5-flag.js +5 -1
  36. package/dist/cjs/version.d.ts +1 -1
  37. package/dist/cjs/version.js +1 -1
  38. package/dist/cjs/video/OffthreadVideo.js +6 -4
  39. package/dist/cjs/video/html5-video.js +4 -4
  40. package/dist/esm/index.mjs +379 -119
  41. package/dist/esm/no-react.mjs +44 -11
  42. package/dist/esm/version.mjs +1 -1
  43. package/package.json +2 -2
  44. package/dist/cjs/interpolate-translate.d.ts +0 -8
  45. package/dist/cjs/interpolate-translate.js +0 -70
  46. package/dist/cjs/sequence-field-schema.d.ts +0 -425
  47. package/dist/cjs/sequence-field-schema.js +0 -133
  48. package/dist/cjs/wrap-in-schema.d.ts +0 -20
  49. package/dist/cjs/wrap-in-schema.js +0 -203
@@ -6,6 +6,7 @@ const react_1 = require("react");
6
6
  const enable_sequence_stack_traces_js_1 = require("../enable-sequence-stack-traces.js");
7
7
  const Sequence_js_1 = require("../Sequence.js");
8
8
  const use_remotion_environment_js_1 = require("../use-remotion-environment.js");
9
+ const v5_flag_js_1 = require("../v5-flag.js");
9
10
  const validate_media_props_js_1 = require("../validate-media-props.js");
10
11
  const validate_start_from_props_js_1 = require("../validate-start-from-props.js");
11
12
  const OffthreadVideoForRendering_js_1 = require("./OffthreadVideoForRendering.js");
@@ -15,6 +16,7 @@ const InnerOffthreadVideo = (props) => {
15
16
  // rest gets drilled down
16
17
  const { startFrom, endAt, trimBefore, trimAfter, name, pauseWhenBuffering, stack, showInTimeline, ...otherProps } = props;
17
18
  const environment = (0, use_remotion_environment_js_1.useRemotionEnvironment)();
19
+ const shouldPauseWhenBuffering = (0, v5_flag_js_1.resolveV5Default)(pauseWhenBuffering);
18
20
  if (environment.isClientSideRendering) {
19
21
  throw new Error('<OffthreadVideo> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations');
20
22
  }
@@ -31,14 +33,14 @@ const InnerOffthreadVideo = (props) => {
31
33
  });
32
34
  if (typeof trimBeforeValue !== 'undefined' ||
33
35
  typeof trimAfterValue !== 'undefined') {
34
- return (jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", from: 0 - (trimBeforeValue !== null && trimBeforeValue !== void 0 ? trimBeforeValue : 0), showInTimeline: false, durationInFrames: trimAfterValue, name: name, children: jsx_runtime_1.jsx(exports.InnerOffthreadVideo, { pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, ...otherProps, trimAfter: undefined, name: undefined, showInTimeline: showInTimeline, trimBefore: undefined, stack: undefined, startFrom: undefined, endAt: undefined }) }));
36
+ return (jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", from: 0 - (trimBeforeValue !== null && trimBeforeValue !== void 0 ? trimBeforeValue : 0), showInTimeline: false, durationInFrames: trimAfterValue, name: name, children: jsx_runtime_1.jsx(exports.InnerOffthreadVideo, { pauseWhenBuffering: shouldPauseWhenBuffering, ...otherProps, trimAfter: undefined, name: undefined, showInTimeline: showInTimeline, trimBefore: undefined, stack: undefined, startFrom: undefined, endAt: undefined }) }));
35
37
  }
36
38
  (0, validate_media_props_js_1.validateMediaProps)(props, 'Video');
37
39
  if (environment.isRendering) {
38
- return (jsx_runtime_1.jsx(OffthreadVideoForRendering_js_1.OffthreadVideoForRendering, { pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, ...otherProps, trimAfter: undefined, name: undefined, showInTimeline: showInTimeline, trimBefore: undefined, stack: undefined, startFrom: undefined, endAt: undefined }));
40
+ return (jsx_runtime_1.jsx(OffthreadVideoForRendering_js_1.OffthreadVideoForRendering, { pauseWhenBuffering: shouldPauseWhenBuffering, ...otherProps, trimAfter: undefined, name: undefined, showInTimeline: showInTimeline, trimBefore: undefined, stack: undefined, startFrom: undefined, endAt: undefined }));
39
41
  }
40
42
  const { transparent, toneMapped, onAutoPlayError, onVideoFrame, crossOrigin, delayRenderRetries, delayRenderTimeoutInMilliseconds, ...propsForPreview } = otherProps;
41
- return (jsx_runtime_1.jsx(VideoForPreview_js_1.VideoForPreview, { _remotionInternalStack: stack !== null && stack !== void 0 ? stack : null, onDuration: onDuration, onlyWarnForMediaSeekingError: true, pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, onAutoPlayError: onAutoPlayError !== null && onAutoPlayError !== void 0 ? onAutoPlayError : undefined, onVideoFrame: onVideoFrame !== null && onVideoFrame !== void 0 ? onVideoFrame : null, crossOrigin: crossOrigin, ...propsForPreview, _remotionInternalNativeLoopPassed: false }));
43
+ return (jsx_runtime_1.jsx(VideoForPreview_js_1.VideoForPreview, { _remotionInternalStack: stack !== null && stack !== void 0 ? stack : null, onDuration: onDuration, onlyWarnForMediaSeekingError: true, pauseWhenBuffering: shouldPauseWhenBuffering, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, onAutoPlayError: onAutoPlayError !== null && onAutoPlayError !== void 0 ? onAutoPlayError : undefined, onVideoFrame: onVideoFrame !== null && onVideoFrame !== void 0 ? onVideoFrame : null, crossOrigin: crossOrigin, ...propsForPreview, _remotionInternalNativeLoopPassed: false }));
42
44
  };
43
45
  exports.InnerOffthreadVideo = InnerOffthreadVideo;
44
46
  /*
@@ -49,7 +51,7 @@ const OffthreadVideo = ({ src, acceptableTimeShiftInSeconds, allowAmplificationD
49
51
  if (imageFormat) {
50
52
  throw new TypeError(`The \`<OffthreadVideo>\` tag does no longer accept \`imageFormat\`. Use the \`transparent\` prop if you want to render a transparent video.`);
51
53
  }
52
- return (jsx_runtime_1.jsx(exports.InnerOffthreadVideo, { acceptableTimeShiftInSeconds: acceptableTimeShiftInSeconds, allowAmplificationDuringRender: allowAmplificationDuringRender !== null && allowAmplificationDuringRender !== void 0 ? allowAmplificationDuringRender : true, audioStreamIndex: audioStreamIndex !== null && audioStreamIndex !== void 0 ? audioStreamIndex : 0, crossOrigin: crossOrigin, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds, loopVolumeCurveBehavior: loopVolumeCurveBehavior !== null && loopVolumeCurveBehavior !== void 0 ? loopVolumeCurveBehavior : 'repeat', muted: muted !== null && muted !== void 0 ? muted : false, name: name, onAutoPlayError: onAutoPlayError !== null && onAutoPlayError !== void 0 ? onAutoPlayError : null, onError: onError, onVideoFrame: onVideoFrame, pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : true, playbackRate: playbackRate !== null && playbackRate !== void 0 ? playbackRate : 1, preservePitch: preservePitch, toneFrequency: toneFrequency !== null && toneFrequency !== void 0 ? toneFrequency : 1, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, src: src, stack: stack, startFrom: startFrom, _remotionInternalNativeLoopPassed: _remotionInternalNativeLoopPassed !== null && _remotionInternalNativeLoopPassed !== void 0 ? _remotionInternalNativeLoopPassed : false, endAt: endAt, style: style, toneMapped: toneMapped !== null && toneMapped !== void 0 ? toneMapped : true, transparent: transparent !== null && transparent !== void 0 ? transparent : false, trimAfter: trimAfter, trimBefore: trimBefore, useWebAudioApi: useWebAudioApi !== null && useWebAudioApi !== void 0 ? useWebAudioApi : false, volume: volume, ...props }));
54
+ return (jsx_runtime_1.jsx(exports.InnerOffthreadVideo, { acceptableTimeShiftInSeconds: acceptableTimeShiftInSeconds, allowAmplificationDuringRender: allowAmplificationDuringRender !== null && allowAmplificationDuringRender !== void 0 ? allowAmplificationDuringRender : true, audioStreamIndex: audioStreamIndex !== null && audioStreamIndex !== void 0 ? audioStreamIndex : 0, crossOrigin: crossOrigin, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds, loopVolumeCurveBehavior: loopVolumeCurveBehavior !== null && loopVolumeCurveBehavior !== void 0 ? loopVolumeCurveBehavior : 'repeat', muted: muted !== null && muted !== void 0 ? muted : false, name: name, onAutoPlayError: onAutoPlayError !== null && onAutoPlayError !== void 0 ? onAutoPlayError : null, onError: onError, onVideoFrame: onVideoFrame, pauseWhenBuffering: (0, v5_flag_js_1.resolveV5Default)(pauseWhenBuffering), playbackRate: playbackRate !== null && playbackRate !== void 0 ? playbackRate : 1, preservePitch: preservePitch, toneFrequency: toneFrequency !== null && toneFrequency !== void 0 ? toneFrequency : 1, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, src: src, stack: stack, startFrom: startFrom, _remotionInternalNativeLoopPassed: _remotionInternalNativeLoopPassed !== null && _remotionInternalNativeLoopPassed !== void 0 ? _remotionInternalNativeLoopPassed : false, endAt: endAt, style: style, toneMapped: toneMapped !== null && toneMapped !== void 0 ? toneMapped : true, transparent: transparent !== null && transparent !== void 0 ? transparent : false, trimAfter: trimAfter, trimBefore: trimBefore, useWebAudioApi: useWebAudioApi !== null && useWebAudioApi !== void 0 ? useWebAudioApi : false, volume: volume, ...props }));
53
55
  };
54
56
  exports.OffthreadVideo = OffthreadVideo;
55
57
  (0, enable_sequence_stack_traces_js_1.addSequenceStackTraces)(exports.OffthreadVideo);
@@ -12,6 +12,7 @@ const prefetch_js_1 = require("../prefetch.js");
12
12
  const Sequence_js_1 = require("../Sequence.js");
13
13
  const use_remotion_environment_js_1 = require("../use-remotion-environment.js");
14
14
  const use_video_config_js_1 = require("../use-video-config.js");
15
+ const v5_flag_js_1 = require("../v5-flag.js");
15
16
  const validate_media_props_js_1 = require("../validate-media-props.js");
16
17
  const validate_start_from_props_js_1 = require("../validate-start-from-props.js");
17
18
  const duration_state_js_1 = require("./duration-state.js");
@@ -23,6 +24,7 @@ const VideoForwardingFunction = (props, ref) => {
23
24
  const { loop, ...propsOtherThanLoop } = props;
24
25
  const { fps } = (0, use_video_config_js_1.useVideoConfig)();
25
26
  const environment = (0, use_remotion_environment_js_1.useRemotionEnvironment)();
27
+ const shouldPauseWhenBuffering = (0, v5_flag_js_1.resolveV5Default)(pauseWhenBuffering);
26
28
  if (environment.isClientSideRendering) {
27
29
  throw new Error('<Html5Video> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations');
28
30
  }
@@ -61,7 +63,7 @@ const VideoForwardingFunction = (props, ref) => {
61
63
  typeof trimAfterValue !== 'undefined') {
62
64
  return (jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", from: 0 - (trimBeforeValue !== null && trimBeforeValue !== void 0 ? trimBeforeValue : 0), showInTimeline: false, durationInFrames: trimAfterValue === undefined
63
65
  ? undefined
64
- : trimAfterValue / ((_c = props.playbackRate) !== null && _c !== void 0 ? _c : 1), name: name, children: jsx_runtime_1.jsx(exports.Html5Video, { pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, onVideoFrame: onVideoFrame, ...otherProps, ref: ref, stack: stack }) }));
66
+ : trimAfterValue / ((_c = props.playbackRate) !== null && _c !== void 0 ? _c : 1), name: name, children: jsx_runtime_1.jsx(exports.Html5Video, { pauseWhenBuffering: shouldPauseWhenBuffering, onVideoFrame: onVideoFrame, ...otherProps, ref: ref, stack: stack }) }));
65
67
  }
66
68
  (0, validate_media_props_js_1.validateMediaProps)({
67
69
  playbackRate: props.playbackRate,
@@ -71,9 +73,7 @@ const VideoForwardingFunction = (props, ref) => {
71
73
  if (environment.isRendering) {
72
74
  return (jsx_runtime_1.jsx(VideoForRendering_js_1.VideoForRendering, { onDuration: onDuration, onVideoFrame: onVideoFrame !== null && onVideoFrame !== void 0 ? onVideoFrame : null, ...otherProps, ref: ref }));
73
75
  }
74
- return (jsx_runtime_1.jsx(VideoForPreview_js_1.VideoForPreview, { onlyWarnForMediaSeekingError: false, ...otherProps, ref: ref, onVideoFrame: onVideoFrame !== null && onVideoFrame !== void 0 ? onVideoFrame : null,
75
- // Proposal: Make this default to true in v5
76
- pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, onDuration: onDuration, _remotionInternalStack: stack !== null && stack !== void 0 ? stack : null, _remotionInternalNativeLoopPassed: _remotionInternalNativeLoopPassed !== null && _remotionInternalNativeLoopPassed !== void 0 ? _remotionInternalNativeLoopPassed : false, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, onAutoPlayError: onAutoPlayError !== null && onAutoPlayError !== void 0 ? onAutoPlayError : undefined }));
76
+ return (jsx_runtime_1.jsx(VideoForPreview_js_1.VideoForPreview, { onlyWarnForMediaSeekingError: false, ...otherProps, ref: ref, onVideoFrame: onVideoFrame !== null && onVideoFrame !== void 0 ? onVideoFrame : null, pauseWhenBuffering: shouldPauseWhenBuffering, onDuration: onDuration, _remotionInternalStack: stack !== null && stack !== void 0 ? stack : null, _remotionInternalNativeLoopPassed: _remotionInternalNativeLoopPassed !== null && _remotionInternalNativeLoopPassed !== void 0 ? _remotionInternalNativeLoopPassed : false, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, onAutoPlayError: onAutoPlayError !== null && onAutoPlayError !== void 0 ? onAutoPlayError : undefined }));
77
77
  };
78
78
  /**
79
79
  * @description Wraps the native `<video>` element to include video in your component that is synchronized with Remotion's time.