remotion 3.2.30 → 3.2.32

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 (92) hide show
  1. package/.turbo/turbo-build.log +5 -5
  2. package/.turbo/turbo-lint.log +11 -0
  3. package/.turbo/turbo-test.log +405 -0
  4. package/README.md +6 -0
  5. package/dist/compress-assets.d.ts +7 -0
  6. package/dist/compress-assets.js +25 -0
  7. package/dist/config/browser-executable.d.ts +3 -0
  8. package/dist/config/browser-executable.js +12 -0
  9. package/dist/config/browser.d.ts +4 -0
  10. package/dist/config/browser.js +19 -0
  11. package/dist/config/chromium-flags.d.ts +10 -0
  12. package/dist/config/chromium-flags.js +34 -0
  13. package/dist/config/codec.d.ts +16 -0
  14. package/dist/config/codec.js +109 -0
  15. package/dist/config/concurrency.d.ts +3 -0
  16. package/dist/config/concurrency.js +12 -0
  17. package/dist/config/crf.d.ts +9 -0
  18. package/dist/config/crf.js +83 -0
  19. package/dist/config/env-file.d.ts +2 -0
  20. package/dist/config/env-file.js +10 -0
  21. package/dist/config/every-nth-frame.d.ts +3 -0
  22. package/dist/config/every-nth-frame.js +20 -0
  23. package/dist/config/ffmpeg-executable.d.ts +5 -0
  24. package/dist/config/ffmpeg-executable.js +21 -0
  25. package/dist/config/frame-range.d.ts +5 -0
  26. package/dist/config/frame-range.js +80 -0
  27. package/dist/config/image-format.d.ts +8 -0
  28. package/dist/config/image-format.js +37 -0
  29. package/dist/config/image-sequence.d.ts +3 -0
  30. package/dist/config/image-sequence.js +15 -0
  31. package/dist/config/index.d.ts +178 -0
  32. package/dist/config/index.js +193 -0
  33. package/dist/config/log.d.ts +7 -0
  34. package/dist/config/log.js +25 -0
  35. package/dist/config/max-timeline-tracks.d.ts +2 -0
  36. package/dist/config/max-timeline-tracks.js +24 -0
  37. package/dist/config/number-of-gif-loops.d.ts +4 -0
  38. package/dist/config/number-of-gif-loops.js +21 -0
  39. package/dist/config/override-webpack.d.ts +6 -0
  40. package/dist/config/override-webpack.js +14 -0
  41. package/dist/config/overwrite.d.ts +3 -0
  42. package/dist/config/overwrite.js +14 -0
  43. package/dist/config/pixel-format.d.ts +8 -0
  44. package/dist/config/pixel-format.js +38 -0
  45. package/dist/config/preview-server.d.ts +2 -0
  46. package/dist/config/preview-server.js +20 -0
  47. package/dist/config/prores-profile.d.ts +7 -0
  48. package/dist/config/prores-profile.js +32 -0
  49. package/dist/config/quality.d.ts +2 -0
  50. package/dist/config/quality.js +17 -0
  51. package/dist/config/scale.d.ts +3 -0
  52. package/dist/config/scale.js +15 -0
  53. package/dist/config/still-frame.d.ts +2 -0
  54. package/dist/config/still-frame.js +12 -0
  55. package/dist/config/timeout.d.ts +2 -0
  56. package/dist/config/timeout.js +17 -0
  57. package/dist/config/webpack-caching.d.ts +3 -0
  58. package/dist/config/webpack-caching.js +16 -0
  59. package/dist/config.d.ts +9 -0
  60. package/dist/feature-flags.d.ts +1 -0
  61. package/dist/feature-flags.js +7 -0
  62. package/dist/index.d.ts +1 -1
  63. package/dist/index.js +3 -2
  64. package/dist/is-audio-codec.d.ts +2 -0
  65. package/dist/is-audio-codec.js +7 -0
  66. package/dist/perf/index.d.ts +5 -0
  67. package/dist/perf/index.js +35 -0
  68. package/dist/preload-state.d.ts +13 -0
  69. package/dist/preload-state.js +26 -0
  70. package/dist/random.d.ts +2 -1
  71. package/dist/timeline-inout-position-state.d.ts +12 -0
  72. package/dist/timeline-inout-position-state.js +23 -0
  73. package/dist/timeout.d.ts +2 -0
  74. package/dist/timeout.js +12 -0
  75. package/dist/validation/validate-every-nth-frame.d.ts +1 -0
  76. package/dist/validation/validate-every-nth-frame.js +21 -0
  77. package/dist/validation/validate-frame.d.ts +1 -0
  78. package/dist/validation/validate-frame.js +24 -0
  79. package/dist/validation/validate-image-format.d.ts +2 -0
  80. package/dist/validation/validate-image-format.js +9 -0
  81. package/dist/validation/validate-opengl-renderer.d.ts +4 -0
  82. package/dist/validation/validate-opengl-renderer.js +14 -0
  83. package/dist/validation/validate-quality.d.ts +1 -0
  84. package/dist/validation/validate-quality.js +21 -0
  85. package/dist/version.d.ts +1 -1
  86. package/dist/version.js +1 -1
  87. package/dist/video/VideoForRendering.js +2 -2
  88. package/package.json +3 -3
  89. package/dist/durations-context.d.ts +0 -1
  90. package/dist/durations-context.js +0 -2
  91. package/dist/video/LoopedVideo.d.ts +0 -3
  92. package/dist/video/LoopedVideo.js +0 -16
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getScale = exports.setScale = void 0;
4
+ let currentScale = 1;
5
+ const setScale = (newScale) => {
6
+ if (typeof newScale !== 'number') {
7
+ throw new Error('--scale flag must be a number.');
8
+ }
9
+ currentScale = newScale;
10
+ };
11
+ exports.setScale = setScale;
12
+ const getScale = () => {
13
+ return currentScale;
14
+ };
15
+ exports.getScale = getScale;
@@ -0,0 +1,2 @@
1
+ export declare const setStillFrame: (frame: number) => void;
2
+ export declare const getStillFrame: () => number;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getStillFrame = exports.setStillFrame = void 0;
4
+ const validate_frame_1 = require("../validation/validate-frame");
5
+ let stillFrame = 0;
6
+ const setStillFrame = (frame) => {
7
+ (0, validate_frame_1.validateFrame)(frame, Infinity);
8
+ stillFrame = frame;
9
+ };
10
+ exports.setStillFrame = setStillFrame;
11
+ const getStillFrame = () => stillFrame;
12
+ exports.getStillFrame = getStillFrame;
@@ -0,0 +1,2 @@
1
+ export declare const setPuppeteerTimeout: (newPuppeteerTimeout: number) => void;
2
+ export declare const getCurrentPuppeteerTimeout: () => number;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getCurrentPuppeteerTimeout = exports.setPuppeteerTimeout = void 0;
4
+ const timeout_1 = require("../timeout");
5
+ let currentTimeout = timeout_1.DEFAULT_PUPPETEER_TIMEOUT;
6
+ const setPuppeteerTimeout = (newPuppeteerTimeout) => {
7
+ if (typeof newPuppeteerTimeout !== 'number') {
8
+ throw new Error('--timeout flag / setTimeoutInMilliseconds() must be a number, but got ' +
9
+ JSON.stringify(newPuppeteerTimeout));
10
+ }
11
+ currentTimeout = newPuppeteerTimeout;
12
+ };
13
+ exports.setPuppeteerTimeout = setPuppeteerTimeout;
14
+ const getCurrentPuppeteerTimeout = () => {
15
+ return currentTimeout;
16
+ };
17
+ exports.getCurrentPuppeteerTimeout = getCurrentPuppeteerTimeout;
@@ -0,0 +1,3 @@
1
+ export declare const DEFAULT_WEBPACK_CACHE_ENABLED = true;
2
+ export declare const setWebpackCaching: (flag: boolean) => void;
3
+ export declare const getWebpackCaching: () => boolean;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getWebpackCaching = exports.setWebpackCaching = exports.DEFAULT_WEBPACK_CACHE_ENABLED = void 0;
4
+ exports.DEFAULT_WEBPACK_CACHE_ENABLED = true;
5
+ let webpackCaching = exports.DEFAULT_WEBPACK_CACHE_ENABLED;
6
+ const setWebpackCaching = (flag) => {
7
+ if (typeof flag !== 'boolean') {
8
+ throw new TypeError('Caching flag must be a boolean.');
9
+ }
10
+ webpackCaching = flag;
11
+ };
12
+ exports.setWebpackCaching = setWebpackCaching;
13
+ const getWebpackCaching = () => {
14
+ return webpackCaching;
15
+ };
16
+ exports.getWebpackCaching = getWebpackCaching;
package/dist/config.d.ts CHANGED
@@ -211,6 +211,15 @@ export declare type ConfigType = {
211
211
  type: 'pre-stitcher' | 'stitcher';
212
212
  args: string[];
213
213
  }) => string[]) => void;
214
+ /**
215
+ * Set a target audio bitrate to be passed to FFMPEG.
216
+ */
217
+ readonly setAudioBitrate: (bitrate: string | null) => void;
218
+ /**
219
+ * Set a target video bitrate to be passed to FFMPEG.
220
+ * Mutually exclusive with setCrf().
221
+ */
222
+ readonly setVideoBitrate: (bitrate: string | null) => void;
214
223
  };
215
224
  };
216
225
  export type { Concurrency, WebpackConfiguration, WebpackOverrideFn };
@@ -0,0 +1 @@
1
+ export declare const FEATURE_FLAG_FIREFOX_SUPPORT = false;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FEATURE_FLAG_FIREFOX_SUPPORT = void 0;
4
+ // There is no Firefox support yet, the waitForFunction method
5
+ // does not yet work and downloading has a bug.
6
+ // Disabling this for now!
7
+ exports.FEATURE_FLAG_FIREFOX_SUPPORT = false;
package/dist/index.d.ts CHANGED
@@ -57,7 +57,7 @@ export * from './interpolate';
57
57
  export { interpolateColors } from './interpolate-colors';
58
58
  export { Loop } from './loop';
59
59
  export { prefetch } from './prefetch';
60
- export * from './random';
60
+ export { random, RandomSeed } from './random';
61
61
  export { registerRoot } from './register-root';
62
62
  export { Sequence } from './Sequence';
63
63
  export { Series } from './series';
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.useCurrentFrame = exports.staticFile = exports.Series = exports.Sequence = exports.registerRoot = exports.prefetch = exports.Loop = exports.interpolateColors = exports.getInputProps = exports.Config = void 0;
17
+ exports.useCurrentFrame = exports.staticFile = exports.Series = exports.Sequence = exports.registerRoot = exports.random = exports.prefetch = exports.Loop = exports.interpolateColors = exports.getInputProps = exports.Config = void 0;
18
18
  require("./asset-types");
19
19
  const multiple_versions_warning_1 = require("./multiple-versions-warning");
20
20
  (0, multiple_versions_warning_1.checkMultipleRemotionVersions)();
@@ -39,7 +39,8 @@ var loop_1 = require("./loop");
39
39
  Object.defineProperty(exports, "Loop", { enumerable: true, get: function () { return loop_1.Loop; } });
40
40
  var prefetch_1 = require("./prefetch");
41
41
  Object.defineProperty(exports, "prefetch", { enumerable: true, get: function () { return prefetch_1.prefetch; } });
42
- __exportStar(require("./random"), exports);
42
+ var random_1 = require("./random");
43
+ Object.defineProperty(exports, "random", { enumerable: true, get: function () { return random_1.random; } });
43
44
  var register_root_1 = require("./register-root");
44
45
  Object.defineProperty(exports, "registerRoot", { enumerable: true, get: function () { return register_root_1.registerRoot; } });
45
46
  var Sequence_1 = require("./Sequence");
@@ -0,0 +1,2 @@
1
+ import type { Codec } from './config';
2
+ export declare const isAudioCodec: (codec: Codec | undefined) => boolean;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isAudioCodec = void 0;
4
+ const isAudioCodec = (codec) => {
5
+ return codec === 'mp3' || codec === 'aac' || codec === 'wav';
6
+ };
7
+ exports.isAudioCodec = isAudioCodec;
@@ -0,0 +1,5 @@
1
+ declare type PerfId = 'activate-target' | 'capture' | 'save' | 'extract-frame' | 'piping';
2
+ export declare const startPerfMeasure: (marker: PerfId) => number;
3
+ export declare const stopPerfMeasure: (id: number) => void;
4
+ export declare const logPerf: () => void;
5
+ export {};
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.logPerf = exports.stopPerfMeasure = exports.startPerfMeasure = void 0;
4
+ const perf = {
5
+ 'activate-target': [],
6
+ capture: [],
7
+ save: [],
8
+ 'extract-frame': [],
9
+ piping: [],
10
+ };
11
+ const map = {};
12
+ const startPerfMeasure = (marker) => {
13
+ const id = Math.random();
14
+ map[id] = {
15
+ id,
16
+ marker,
17
+ start: Date.now(),
18
+ };
19
+ return id;
20
+ };
21
+ exports.startPerfMeasure = startPerfMeasure;
22
+ const stopPerfMeasure = (id) => {
23
+ const now = Date.now();
24
+ const diff = now - map[id].start;
25
+ perf[map[id].marker].push(diff);
26
+ delete map[id];
27
+ };
28
+ exports.stopPerfMeasure = stopPerfMeasure;
29
+ const logPerf = () => {
30
+ console.log('Render performance:');
31
+ Object.keys(perf).forEach((p) => {
32
+ console.log(` ${p} => ${perf[p].reduce((a, b) => a + b, 0) / perf[p].length} (n = ${perf[p].length})`);
33
+ });
34
+ };
35
+ exports.logPerf = logPerf;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ declare type Value = {
3
+ preloads: Record<string, string>;
4
+ setPreloads: React.Dispatch<React.SetStateAction<Record<string, string>>>;
5
+ };
6
+ export declare const preloadRef: React.RefObject<{
7
+ setPreloads: React.Dispatch<React.SetStateAction<Record<string, string>>>;
8
+ }>;
9
+ export declare const PreloadContext: React.Context<Value>;
10
+ export declare const PreloadProvider: React.FC<{
11
+ children: React.ReactNode;
12
+ }>;
13
+ export {};
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PreloadProvider = exports.PreloadContext = exports.preloadRef = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ exports.preloadRef = (0, react_1.createRef)();
7
+ exports.PreloadContext = (0, react_1.createContext)({
8
+ preloads: {},
9
+ setPreloads: () => undefined,
10
+ });
11
+ const PreloadProvider = ({ children }) => {
12
+ const [preloads, setPreloads] = (0, react_1.useState)({});
13
+ const value = (0, react_1.useMemo)(() => {
14
+ return {
15
+ preloads,
16
+ setPreloads,
17
+ };
18
+ }, [preloads]);
19
+ (0, react_1.useImperativeHandle)(exports.preloadRef, () => {
20
+ return {
21
+ setPreloads,
22
+ };
23
+ });
24
+ return ((0, jsx_runtime_1.jsx)(exports.PreloadContext.Provider, { value: value, children: children }));
25
+ };
26
+ exports.PreloadProvider = PreloadProvider;
package/dist/random.d.ts CHANGED
@@ -1,6 +1,7 @@
1
+ export declare type RandomSeed = number | string | null;
1
2
  /**
2
3
  * A deterministic pseudo-random number generator.
3
4
  * Pass in the same seed and get the same pseudorandom number.
4
5
  * See: https://remotion.dev/docs/random
5
6
  */
6
- export declare const random: (seed: number | string | null, dummy?: unknown) => number;
7
+ export declare const random: (seed: RandomSeed, dummy?: unknown) => number;
@@ -0,0 +1,12 @@
1
+ import type React from 'react';
2
+ export declare type TimelineInOutContextValue = {
3
+ inFrame: number | null;
4
+ outFrame: number | null;
5
+ };
6
+ export declare type SetTimelineInOutContextValue = {
7
+ setInAndOutFrames: (u: React.SetStateAction<TimelineInOutContextValue>) => void;
8
+ };
9
+ export declare const TimelineInOutContext: React.Context<TimelineInOutContextValue>;
10
+ export declare const SetTimelineInOutContext: React.Context<SetTimelineInOutContextValue>;
11
+ export declare const useTimelineInOutFramePosition: () => TimelineInOutContextValue;
12
+ export declare const useTimelineSetInOutFramePosition: () => SetTimelineInOutContextValue;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useTimelineSetInOutFramePosition = exports.useTimelineInOutFramePosition = exports.SetTimelineInOutContext = exports.TimelineInOutContext = void 0;
4
+ const react_1 = require("react");
5
+ exports.TimelineInOutContext = (0, react_1.createContext)({
6
+ inFrame: null,
7
+ outFrame: null,
8
+ });
9
+ exports.SetTimelineInOutContext = (0, react_1.createContext)({
10
+ setInAndOutFrames: () => {
11
+ throw new Error('default');
12
+ },
13
+ });
14
+ const useTimelineInOutFramePosition = () => {
15
+ const state = (0, react_1.useContext)(exports.TimelineInOutContext);
16
+ return state;
17
+ };
18
+ exports.useTimelineInOutFramePosition = useTimelineInOutFramePosition;
19
+ const useTimelineSetInOutFramePosition = () => {
20
+ const { setInAndOutFrames } = (0, react_1.useContext)(exports.SetTimelineInOutContext);
21
+ return { setInAndOutFrames };
22
+ };
23
+ exports.useTimelineSetInOutFramePosition = useTimelineSetInOutFramePosition;
@@ -0,0 +1,2 @@
1
+ export declare const DEFAULT_PUPPETEER_TIMEOUT = 30000;
2
+ export declare const setupPuppeteerTimeout: () => void;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setupPuppeteerTimeout = exports.DEFAULT_PUPPETEER_TIMEOUT = void 0;
4
+ exports.DEFAULT_PUPPETEER_TIMEOUT = 30000;
5
+ const getPuppeteerTimeout = () => {
6
+ const param = window.remotion_puppeteerTimeout;
7
+ return param ? Number(param) : exports.DEFAULT_PUPPETEER_TIMEOUT;
8
+ };
9
+ const setupPuppeteerTimeout = () => {
10
+ window.remotion_puppeteerTimeout = getPuppeteerTimeout();
11
+ };
12
+ exports.setupPuppeteerTimeout = setupPuppeteerTimeout;
@@ -0,0 +1 @@
1
+ export declare const validateEveryNthFrame: (everyNthFrame: unknown) => void;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateEveryNthFrame = void 0;
4
+ const validateEveryNthFrame = (everyNthFrame) => {
5
+ if (typeof everyNthFrame === 'undefined') {
6
+ throw new TypeError(`Argument missing for parameter "everyNthFrame"`);
7
+ }
8
+ if (typeof everyNthFrame !== 'number') {
9
+ throw new TypeError(`Argument passed to "everyNthFrame" is not a number: ${everyNthFrame}`);
10
+ }
11
+ if (everyNthFrame < 1) {
12
+ throw new RangeError(`The value for "everyNthFrame" cannot be below 1, but is ${everyNthFrame}`);
13
+ }
14
+ if (!Number.isFinite(everyNthFrame)) {
15
+ throw new RangeError(`"everyNthFrame" ${everyNthFrame} is not finite`);
16
+ }
17
+ if (everyNthFrame % 1 !== 0) {
18
+ throw new RangeError(`Argument for everyNthFrame must be an integer, but got ${everyNthFrame}`);
19
+ }
20
+ };
21
+ exports.validateEveryNthFrame = validateEveryNthFrame;
@@ -0,0 +1 @@
1
+ export declare const validateFrame: (frame: number, durationInFrames: number) => void;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateFrame = void 0;
4
+ const validateFrame = (frame, durationInFrames) => {
5
+ if (typeof frame === 'undefined') {
6
+ throw new TypeError(`Argument missing for parameter "frame"`);
7
+ }
8
+ if (typeof frame !== 'number') {
9
+ throw new TypeError(`Argument passed for "frame" is not a number: ${frame}`);
10
+ }
11
+ if (frame < 0) {
12
+ throw new RangeError(`Frame ${frame} cannot be negative`);
13
+ }
14
+ if (!Number.isFinite(frame)) {
15
+ throw new RangeError(`Frame ${frame} is not finite`);
16
+ }
17
+ if (frame % 1 !== 0) {
18
+ throw new RangeError(`Argument for frame must be an integer, but got ${frame}`);
19
+ }
20
+ if (frame > durationInFrames - 1) {
21
+ throw new RangeError(`Cannot use frame ${frame}: Duration of composition is ${durationInFrames}, therefore the highest frame that can be rendered is ${durationInFrames - 1}`);
22
+ }
23
+ };
24
+ exports.validateFrame = validateFrame;
@@ -0,0 +1,2 @@
1
+ import type { ImageFormat } from '../config';
2
+ export declare const validateNonNullImageFormat: (imageFormat: ImageFormat) => void;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateNonNullImageFormat = void 0;
4
+ const validateNonNullImageFormat = (imageFormat) => {
5
+ if (imageFormat !== 'jpeg' && imageFormat !== 'png') {
6
+ throw new TypeError('Image format should be either "png" or "jpeg"');
7
+ }
8
+ };
9
+ exports.validateNonNullImageFormat = validateNonNullImageFormat;
@@ -0,0 +1,4 @@
1
+ declare const validRenderers: readonly ["swangle", "angle", "egl", "swiftshader"];
2
+ export declare type OpenGlRenderer = typeof validRenderers[number];
3
+ export declare const validateOpenGlRenderer: (option: OpenGlRenderer | null) => OpenGlRenderer | null;
4
+ export {};
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateOpenGlRenderer = void 0;
4
+ const validRenderers = ['swangle', 'angle', 'egl', 'swiftshader'];
5
+ const validateOpenGlRenderer = (option) => {
6
+ if (option === null) {
7
+ return null;
8
+ }
9
+ if (!validRenderers.includes(option)) {
10
+ throw new TypeError(`${option} is not a valid GL backend. Accepted values: ${validRenderers.join(', ')}`);
11
+ }
12
+ return option;
13
+ };
14
+ exports.validateOpenGlRenderer = validateOpenGlRenderer;
@@ -0,0 +1 @@
1
+ export declare const validateQuality: (q: number | undefined) => void;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateQuality = void 0;
4
+ const validateQuality = (q) => {
5
+ if (typeof q !== 'undefined' && typeof q !== 'number') {
6
+ throw new Error(`Quality option must be a number or undefined. Got ${typeof q} (${JSON.stringify(q)})`);
7
+ }
8
+ if (typeof q === 'undefined') {
9
+ return;
10
+ }
11
+ if (!Number.isFinite(q)) {
12
+ throw new RangeError(`Quality must be a finite number, but is ${q}`);
13
+ }
14
+ if (Number.isNaN(q)) {
15
+ throw new RangeError(`Quality is NaN, but must be a real number`);
16
+ }
17
+ if (q > 100 || q < 0) {
18
+ throw new RangeError('Quality option must be between 0 and 100.');
19
+ }
20
+ };
21
+ exports.validateQuality = validateQuality;
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "3.2.30";
1
+ export declare const VERSION = "3.2.32";
package/dist/version.js CHANGED
@@ -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 = '3.2.30';
5
+ exports.VERSION = '3.2.32';
@@ -17,7 +17,7 @@ const use_unsafe_video_config_1 = require("../use-unsafe-video-config");
17
17
  const volume_prop_1 = require("../volume-prop");
18
18
  const warn_about_non_seekable_media_1 = require("../warn-about-non-seekable-media");
19
19
  const get_current_time_1 = require("./get-current-time");
20
- const VideoForRenderingForwardFunction = ({ onError, volume: volumeProp, playbackRate, ...props }, ref) => {
20
+ const VideoForRenderingForwardFunction = ({ onError, volume: volumeProp, playbackRate, onDuration, ...props }, ref) => {
21
21
  const absoluteFrame = (0, timeline_position_state_1.useTimelinePosition)();
22
22
  const frame = (0, use_current_frame_1.useCurrentFrame)();
23
23
  const volumePropsFrame = (0, use_audio_frame_1.useFrameForVolumeProp)();
@@ -164,7 +164,7 @@ const VideoForRenderingForwardFunction = ({ onError, volume: volumeProp, playbac
164
164
  frame,
165
165
  mediaStartsAt,
166
166
  ]);
167
- const { src, onDuration } = props;
167
+ const { src } = props;
168
168
  // If video source switches, make new handle
169
169
  if ((0, get_environment_1.getRemotionEnvironment)() === 'rendering') {
170
170
  // eslint-disable-next-line react-hooks/rules-of-hooks
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remotion",
3
- "version": "3.2.30",
3
+ "version": "3.2.32",
4
4
  "description": "Render videos in React",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -40,7 +40,7 @@
40
40
  "react-test-renderer": "^18.0.0",
41
41
  "rimraf": "^3.0.2",
42
42
  "typescript": "^4.7.0",
43
- "vitest": "^0.18.0",
43
+ "vitest": "0.18.0",
44
44
  "webpack": "5.74.0"
45
45
  },
46
46
  "keywords": [
@@ -54,5 +54,5 @@
54
54
  "publishConfig": {
55
55
  "access": "public"
56
56
  },
57
- "gitHead": "5dc5f4c010c47186c7911b575998296d6a65f7cb"
57
+ "gitHead": "4f7ab3637405d140041f898f95f78c99943d1b40"
58
58
  }
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import type { RemotionMainVideoProps, RemotionVideoProps } from './props';
3
- export declare const LoopedVideo: React.ForwardRefRenderFunction<HTMLVideoElement, RemotionVideoProps & RemotionMainVideoProps>;
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LoopedVideo = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const delay_render_1 = require("../delay-render");
7
- const loop_1 = require("../loop");
8
- const Video_1 = require("./Video");
9
- const LoopedVideo = (props, ref) => {
10
- const [videoDuration, setVideoDuration] = (0, react_1.useState)(null);
11
- (0, react_1.useEffect)(() => {
12
- const newHandle = (0, delay_render_1.delayRender)('Loading <Img> with src=' + props.src);
13
- }, [props.src]);
14
- return ((0, jsx_runtime_1.jsx)(loop_1.Loop, { durationInFrames: Math.round(videoDuration * fps), children: (0, jsx_runtime_1.jsx)(Video_1.Video, { ...props, ref: ref, loop: false }) }));
15
- };
16
- exports.LoopedVideo = LoopedVideo;