remotion 3.2.4 → 3.2.6
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/.turbo/turbo-build.log +5 -5
- package/README.md +5 -4
- package/dist/Sequence.js +1 -2
- package/dist/Still.d.ts +1 -0
- package/dist/audio/AudioForDevelopment.d.ts +3 -2
- package/dist/audio/AudioForRendering.d.ts +5 -2
- package/dist/audio/AudioForRendering.js +2 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1 -0
- package/dist/internals.d.ts +1 -1
- package/dist/internals.js +0 -2
- package/dist/loop/index.js +4 -3
- package/dist/multiple-versions-warning.js +18 -4
- package/dist/use-current-frame.d.ts +0 -1
- package/dist/use-current-frame.js +2 -7
- package/dist/use-media-playback.js +1 -1
- package/dist/version.d.ts +1 -0
- package/dist/version.js +5 -0
- package/dist/video/OffthreadVideoForRendering.js +2 -1
- package/dist/video/VideoForDevelopment.d.ts +3 -2
- package/dist/video/VideoForDevelopment.js +3 -2
- package/dist/video/VideoForRendering.d.ts +5 -2
- package/dist/video/VideoForRendering.js +3 -2
- package/ensure-correct-version.js +24 -0
- package/package.json +4 -4
- package/version.d.ts +1 -0
- package/version.js +1 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
[
|
|
2
|
-
[
|
|
3
|
-
[
|
|
4
|
-
[
|
|
5
|
-
[
|
|
1
|
+
[33mremotion:build: [0mcache hit, replaying output [2m841c0ab7c9d0efb3[0m
|
|
2
|
+
[33mremotion:build: [0m
|
|
3
|
+
[33mremotion:build: [0m> remotion@3.2.5 build /Users/jonathanburger/remotion/packages/core
|
|
4
|
+
[33mremotion:build: [0m> tsc -d
|
|
5
|
+
[33mremotion:build: [0m
|
package/README.md
CHANGED
|
@@ -26,22 +26,23 @@ Remotion is a suite of libraries building a foundation for **creating videos pro
|
|
|
26
26
|
- **"The X in MDX" talk** [Watch](https://twitter.com/pomber/status/1359556846688886789) • [Source code](https://github.com/pomber/record-talk-with-remotion) • A re-recording of [this talk](https://www.youtube.com/watch?v=xEu3t-KJVVg) using Remotion.
|
|
27
27
|
- **Redesigning the Scatterplot** [Watch](https://twitter.com/BrooksLybrand/status/1371547875109445635) • [Source code](https://github.com/brookslybrand/redesigning-scatterplots) • An animated section of Edward R. Tufte's book [The Visual Display of Quantitative Information](https://www.amazon.com/Visual-Display-Quantitative-Information/dp/0961392142/ref=sr_1_1?crid=3HQZSBUUROV09&dchild=1&keywords=the+visual+display+of+quantitative+information&qid=1615907320&sprefix=the+visual+disp%2Caps%2C190&sr=8-1).
|
|
28
28
|
- **News Podcast Maker** [Watch](https://www.youtube.com/watch?v=Mwo5iNlWryg) • [Source code](https://github.com/FelippeChemello/podcast-maker/) • A fully automated News Podcast Maker.
|
|
29
|
+
- **This video was made with code. But how?** [Watch](https://youtu.be/deg8bOoziaE) • [Source code](https://github.com/wcandillon/remotion-fireship) • A YouTube tutorial about Remotion, made with Remotion
|
|
29
30
|
|
|
30
|
-
|
|
31
|
+
See even more creations in the [Showcase](https://remotion.dev/showcase).
|
|
31
32
|
|
|
32
33
|
## Get started
|
|
33
34
|
|
|
34
|
-
If you already have
|
|
35
|
+
If you already have Node.JS and FFMPEG installed, type
|
|
35
36
|
|
|
36
37
|
```console
|
|
37
|
-
|
|
38
|
+
npm init video
|
|
38
39
|
```
|
|
39
40
|
|
|
40
41
|
to get started. Otherwise, read the [installation page](https://www.remotion.dev/docs/) in the documentation.
|
|
41
42
|
|
|
42
43
|
## Documentation
|
|
43
44
|
|
|
44
|
-
Head to [**remotion.dev**](https://www.remotion.dev) to learn the in and outs of Remotion!
|
|
45
|
+
Head to [**remotion.dev/docs**](https://www.remotion.dev/docs) to learn the in and outs of Remotion!
|
|
45
46
|
|
|
46
47
|
## License
|
|
47
48
|
|
package/dist/Sequence.js
CHANGED
|
@@ -8,7 +8,6 @@ const CompositionManager_1 = require("./CompositionManager");
|
|
|
8
8
|
const get_timeline_clip_name_1 = require("./get-timeline-clip-name");
|
|
9
9
|
const nonce_1 = require("./nonce");
|
|
10
10
|
const timeline_position_state_1 = require("./timeline-position-state");
|
|
11
|
-
const use_current_frame_1 = require("./use-current-frame");
|
|
12
11
|
const use_unsafe_video_config_1 = require("./use-unsafe-video-config");
|
|
13
12
|
exports.SequenceContext = (0, react_1.createContext)(null);
|
|
14
13
|
const Sequence = ({ from, durationInFrames = Infinity, children, name, showInTimeline = true, showLoopTimesInTimeline, ...other }) => {
|
|
@@ -44,7 +43,7 @@ const Sequence = ({ from, durationInFrames = Infinity, children, name, showInTim
|
|
|
44
43
|
if (from % 1 !== 0) {
|
|
45
44
|
throw new TypeError(`The "from" prop of a sequence must be an integer, but got ${from}.`);
|
|
46
45
|
}
|
|
47
|
-
const absoluteFrame = (0,
|
|
46
|
+
const absoluteFrame = (0, timeline_position_state_1.useTimelinePosition)();
|
|
48
47
|
const unsafeVideoConfig = (0, use_unsafe_video_config_1.useUnsafeVideoConfig)();
|
|
49
48
|
const compositionDuration = unsafeVideoConfig
|
|
50
49
|
? unsafeVideoConfig.durationInFrames
|
package/dist/Still.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
export declare const AudioForDevelopment:
|
|
3
|
+
export declare const AudioForDevelopment: ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>, "onEnded" | "autoPlay" | "controls" | "loop"> & {
|
|
3
4
|
volume?: import("../volume-prop").VolumeProp | undefined;
|
|
4
5
|
playbackRate?: number | undefined;
|
|
5
6
|
} & {
|
|
6
7
|
shouldPreMountAudioTags: boolean;
|
|
7
|
-
}
|
|
8
|
+
} & RefAttributes<HTMLAudioElement>>;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import type { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
export declare const AudioForRendering: ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>, "onEnded" | "autoPlay" | "controls" | "loop"> & {
|
|
4
|
+
volume?: import("../volume-prop").VolumeProp | undefined;
|
|
5
|
+
playbackRate?: number | undefined;
|
|
6
|
+
} & RefAttributes<HTMLAudioElement>>;
|
|
@@ -7,12 +7,13 @@ const absolute_src_1 = require("../absolute-src");
|
|
|
7
7
|
const CompositionManager_1 = require("../CompositionManager");
|
|
8
8
|
const random_1 = require("../random");
|
|
9
9
|
const Sequence_1 = require("../Sequence");
|
|
10
|
+
const timeline_position_state_1 = require("../timeline-position-state");
|
|
10
11
|
const use_current_frame_1 = require("../use-current-frame");
|
|
11
12
|
const volume_prop_1 = require("../volume-prop");
|
|
12
13
|
const use_audio_frame_1 = require("./use-audio-frame");
|
|
13
14
|
const AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
14
15
|
const audioRef = (0, react_1.useRef)(null);
|
|
15
|
-
const absoluteFrame = (0,
|
|
16
|
+
const absoluteFrame = (0, timeline_position_state_1.useTimelinePosition)();
|
|
16
17
|
const volumePropFrame = (0, use_audio_frame_1.useFrameForVolumeProp)();
|
|
17
18
|
const frame = (0, use_current_frame_1.useCurrentFrame)();
|
|
18
19
|
const sequenceContext = (0, react_1.useContext)(Sequence_1.SequenceContext);
|
package/dist/index.d.ts
CHANGED
|
@@ -20,10 +20,11 @@ declare global {
|
|
|
20
20
|
remotion_envVariables: string;
|
|
21
21
|
remotion_collectAssets: () => TAsset[];
|
|
22
22
|
remotion_isPlayer: boolean;
|
|
23
|
-
remotion_imported: boolean;
|
|
24
23
|
remotion_isBuilding: undefined | (() => void);
|
|
25
24
|
remotion_finishedBuilding: undefined | (() => void);
|
|
26
25
|
siteVersion: '4';
|
|
26
|
+
remotion_version: string;
|
|
27
|
+
remotion_imported: string | boolean;
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
30
|
export declare type BundleState = {
|
|
@@ -60,5 +61,6 @@ export * from './Still';
|
|
|
60
61
|
export type { PlayableMediaTag } from './timeline-position-state';
|
|
61
62
|
export { useCurrentFrame } from './use-current-frame';
|
|
62
63
|
export * from './use-video-config';
|
|
64
|
+
export * from './version';
|
|
63
65
|
export * from './video';
|
|
64
66
|
export * from './video-config';
|
package/dist/index.js
CHANGED
|
@@ -51,5 +51,6 @@ __exportStar(require("./Still"), exports);
|
|
|
51
51
|
var use_current_frame_1 = require("./use-current-frame");
|
|
52
52
|
Object.defineProperty(exports, "useCurrentFrame", { enumerable: true, get: function () { return use_current_frame_1.useCurrentFrame; } });
|
|
53
53
|
__exportStar(require("./use-video-config"), exports);
|
|
54
|
+
__exportStar(require("./version"), exports);
|
|
54
55
|
__exportStar(require("./video"), exports);
|
|
55
56
|
__exportStar(require("./video-config"), exports);
|
package/dist/internals.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import type { Configuration } from 'webpack';
|
|
2
3
|
import type { CompProps } from './Composition';
|
|
3
4
|
import type { CompositionManagerContext, TAsset, TCompMetadata, TComposition, TSequence } from './CompositionManager';
|
|
@@ -59,7 +60,6 @@ export declare const Internals: {
|
|
|
59
60
|
getCompositions: () => TCompMetadata[];
|
|
60
61
|
}>;
|
|
61
62
|
DELAY_RENDER_CALLSTACK_TOKEN: string;
|
|
62
|
-
useAbsoluteCurrentFrame: () => number;
|
|
63
63
|
portalNode: () => HTMLElement;
|
|
64
64
|
waitForRoot: (fn: (comp: import("react").FC<{}>) => void) => () => void;
|
|
65
65
|
validateOffthreadVideoImageFormat: (input: unknown) => void;
|
package/dist/internals.js
CHANGED
|
@@ -39,7 +39,6 @@ const Sequence_1 = require("./Sequence");
|
|
|
39
39
|
const setup_env_variables_1 = require("./setup-env-variables");
|
|
40
40
|
const TimelinePosition = __importStar(require("./timeline-position-state"));
|
|
41
41
|
const truthy_1 = require("./truthy");
|
|
42
|
-
const use_current_frame_1 = require("./use-current-frame");
|
|
43
42
|
const use_lazy_component_1 = require("./use-lazy-component");
|
|
44
43
|
const use_unsafe_video_config_1 = require("./use-unsafe-video-config");
|
|
45
44
|
const use_video_1 = require("./use-video");
|
|
@@ -83,7 +82,6 @@ exports.Internals = {
|
|
|
83
82
|
getPreviewDomElement: get_preview_dom_element_1.getPreviewDomElement,
|
|
84
83
|
compositionsRef: CompositionManager_1.compositionsRef,
|
|
85
84
|
DELAY_RENDER_CALLSTACK_TOKEN: delay_render_1.DELAY_RENDER_CALLSTACK_TOKEN,
|
|
86
|
-
useAbsoluteCurrentFrame: use_current_frame_1.useAbsoluteCurrentFrame,
|
|
87
85
|
portalNode: portal_node_1.portalNode,
|
|
88
86
|
waitForRoot: register_root_1.waitForRoot,
|
|
89
87
|
validateOffthreadVideoImageFormat: validate_offthreadvideo_image_format_1.validateOffthreadVideoImageFormat,
|
package/dist/loop/index.js
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Loop = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const
|
|
5
|
+
const Sequence_1 = require("../Sequence");
|
|
6
|
+
const use_video_config_1 = require("../use-video-config");
|
|
6
7
|
const validate_duration_in_frames_1 = require("../validation/validate-duration-in-frames");
|
|
7
8
|
const Loop = ({ durationInFrames, times = Infinity, children, layout, name, }) => {
|
|
8
|
-
const { durationInFrames: compDuration } = (0,
|
|
9
|
+
const { durationInFrames: compDuration } = (0, use_video_config_1.useVideoConfig)();
|
|
9
10
|
(0, validate_duration_in_frames_1.validateDurationInFrames)(durationInFrames, 'of the <Loop /> component');
|
|
10
11
|
if (typeof times !== 'number') {
|
|
11
12
|
throw new TypeError(`You passed to "times" an argument of type ${typeof times}, but it must be a number.`);
|
|
@@ -19,7 +20,7 @@ const Loop = ({ durationInFrames, times = Infinity, children, layout, name, }) =
|
|
|
19
20
|
const maxTimes = Math.ceil(compDuration / durationInFrames);
|
|
20
21
|
const actualTimes = Math.min(maxTimes, times);
|
|
21
22
|
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: new Array(actualTimes).fill(true).map((_, i) => {
|
|
22
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
23
|
+
return ((0, jsx_runtime_1.jsx)(Sequence_1.Sequence
|
|
23
24
|
// eslint-disable-next-line react/no-array-index-key
|
|
24
25
|
, { durationInFrames: durationInFrames, from: i * durationInFrames, layout: layout, name: name, showLoopTimesInTimeline: actualTimes, showInTimeline: i === 0, children: children }, `loop-${i}`));
|
|
25
26
|
}) }));
|
|
@@ -1,13 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.checkMultipleRemotionVersions = void 0;
|
|
4
|
+
const truthy_1 = require("./truthy");
|
|
5
|
+
const version_1 = require("./version");
|
|
4
6
|
const checkMultipleRemotionVersions = () => {
|
|
5
|
-
if (typeof
|
|
7
|
+
if (typeof globalThis === 'undefined') {
|
|
6
8
|
return;
|
|
7
9
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
const alreadyImported = globalThis.remotion_imported ||
|
|
11
|
+
(typeof window !== 'undefined' && window.remotion_imported);
|
|
12
|
+
if (alreadyImported) {
|
|
13
|
+
throw new TypeError(`🚨 Multiple versions of Remotion detected: ${[
|
|
14
|
+
version_1.VERSION,
|
|
15
|
+
typeof alreadyImported === 'string'
|
|
16
|
+
? alreadyImported
|
|
17
|
+
: 'an older version',
|
|
18
|
+
]
|
|
19
|
+
.filter(truthy_1.truthy)
|
|
20
|
+
.join(' and ')}. This will cause things to break in an unexpected way.\nCheck that all your Remotion packages are on the same version. If your dependencies depend on Remotion, make them peer dependencies. You can also run \`npx remotion versions\` from your terminal to see which versions are mismatching.`);
|
|
21
|
+
}
|
|
22
|
+
globalThis.remotion_imported = true;
|
|
23
|
+
if (typeof window !== 'undefined') {
|
|
24
|
+
window.remotion_imported = version_1.VERSION;
|
|
10
25
|
}
|
|
11
|
-
window.remotion_imported = true;
|
|
12
26
|
};
|
|
13
27
|
exports.checkMultipleRemotionVersions = checkMultipleRemotionVersions;
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useCurrentFrame =
|
|
3
|
+
exports.useCurrentFrame = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const CanUseRemotionHooks_1 = require("./CanUseRemotionHooks");
|
|
6
6
|
const Sequence_1 = require("./Sequence");
|
|
7
7
|
const timeline_position_state_1 = require("./timeline-position-state");
|
|
8
|
-
const useAbsoluteCurrentFrame = () => {
|
|
9
|
-
const timelinePosition = (0, timeline_position_state_1.useTimelinePosition)();
|
|
10
|
-
return timelinePosition;
|
|
11
|
-
};
|
|
12
|
-
exports.useAbsoluteCurrentFrame = useAbsoluteCurrentFrame;
|
|
13
8
|
/**
|
|
14
9
|
* Get the current frame of the video.
|
|
15
10
|
* Frames are 0-indexed, meaning the first frame is 0, the last frame is the duration of the composition in frames minus one.
|
|
@@ -23,7 +18,7 @@ const useCurrentFrame = () => {
|
|
|
23
18
|
}
|
|
24
19
|
throw new Error(`useCurrentFrame() can only be called inside a component that was registered as a composition. See https://www.remotion.dev/docs/the-fundamentals#defining-compositions`);
|
|
25
20
|
}
|
|
26
|
-
const frame = (0,
|
|
21
|
+
const frame = (0, timeline_position_state_1.useTimelinePosition)();
|
|
27
22
|
const context = (0, react_1.useContext)(Sequence_1.SequenceContext);
|
|
28
23
|
const contextOffset = context
|
|
29
24
|
? context.cumulatedFrom + context.relativeFrom
|
|
@@ -12,7 +12,7 @@ const warn_about_non_seekable_media_1 = require("./warn-about-non-seekable-media
|
|
|
12
12
|
const useMediaPlayback = ({ mediaRef, src, mediaType, playbackRate: localPlaybackRate, onlyWarnForMediaSeekingError, }) => {
|
|
13
13
|
const { playbackRate: globalPlaybackRate } = (0, react_1.useContext)(timeline_position_state_1.TimelineContext);
|
|
14
14
|
const frame = (0, use_current_frame_1.useCurrentFrame)();
|
|
15
|
-
const absoluteFrame = (0,
|
|
15
|
+
const absoluteFrame = (0, timeline_position_state_1.useTimelinePosition)();
|
|
16
16
|
const [playing] = (0, timeline_position_state_1.usePlayingState)();
|
|
17
17
|
const { fps } = (0, use_video_config_1.useVideoConfig)();
|
|
18
18
|
const mediaStartsAt = (0, use_audio_frame_1.useMediaStartsAt)();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const VERSION = "3.2.6";
|
package/dist/version.js
ADDED
|
@@ -11,13 +11,14 @@ const Img_1 = require("../Img");
|
|
|
11
11
|
const internals_1 = require("../internals");
|
|
12
12
|
const random_1 = require("../random");
|
|
13
13
|
const Sequence_1 = require("../Sequence");
|
|
14
|
+
const timeline_position_state_1 = require("../timeline-position-state");
|
|
14
15
|
const use_current_frame_1 = require("../use-current-frame");
|
|
15
16
|
const use_unsafe_video_config_1 = require("../use-unsafe-video-config");
|
|
16
17
|
const volume_prop_1 = require("../volume-prop");
|
|
17
18
|
const get_current_time_1 = require("./get-current-time");
|
|
18
19
|
const DEFAULT_IMAGE_FORMAT = 'jpeg';
|
|
19
20
|
const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate, src, muted, imageFormat, ...props }) => {
|
|
20
|
-
const absoluteFrame = (0,
|
|
21
|
+
const absoluteFrame = (0, timeline_position_state_1.useTimelinePosition)();
|
|
21
22
|
const frame = (0, use_current_frame_1.useCurrentFrame)();
|
|
22
23
|
const volumePropsFrame = (0, use_audio_frame_1.useFrameForVolumeProp)();
|
|
23
24
|
const videoConfig = (0, use_unsafe_video_config_1.useUnsafeVideoConfig)();
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
export declare const VideoForDevelopment:
|
|
3
|
+
export declare const VideoForDevelopment: ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>, "onEnded" | "autoPlay" | "controls" | "loop"> & {
|
|
3
4
|
volume?: import("../volume-prop").VolumeProp | undefined;
|
|
4
5
|
playbackRate?: number | undefined;
|
|
5
6
|
} & {
|
|
6
7
|
onlyWarnForMediaSeekingError: boolean;
|
|
7
|
-
}
|
|
8
|
+
} & RefAttributes<HTMLVideoElement>>;
|
|
@@ -50,7 +50,7 @@ const VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
|
50
50
|
var _a;
|
|
51
51
|
if (current === null || current === void 0 ? void 0 : current.error) {
|
|
52
52
|
console.error('Error occurred in video', current === null || current === void 0 ? void 0 : current.error);
|
|
53
|
-
throw new Error(`The browser threw an error while playing the video: Code ${current.error.code} - ${(_a = current === null || current === void 0 ? void 0 : current.error) === null || _a === void 0 ? void 0 : _a.message}. See https://remotion.dev/docs/media-playback-error for help`);
|
|
53
|
+
throw new Error(`The browser threw an error while playing the video ${nativeProps.src}: Code ${current.error.code} - ${(_a = current === null || current === void 0 ? void 0 : current.error) === null || _a === void 0 ? void 0 : _a.message}. See https://remotion.dev/docs/media-playback-error for help`);
|
|
54
54
|
}
|
|
55
55
|
else {
|
|
56
56
|
throw new Error('The browser threw an error');
|
|
@@ -60,7 +60,8 @@ const VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
|
60
60
|
return () => {
|
|
61
61
|
current.removeEventListener('error', errorHandler);
|
|
62
62
|
};
|
|
63
|
-
}, []);
|
|
63
|
+
}, [nativeProps.src]);
|
|
64
64
|
return ((0, jsx_runtime_1.jsx)("video", { ref: videoRef, muted: muted || mediaMuted, playsInline: true, ...nativeProps }));
|
|
65
65
|
};
|
|
66
|
+
// Copy types from forwardRef but not necessary to remove ref
|
|
66
67
|
exports.VideoForDevelopment = (0, react_1.forwardRef)(VideoForDevelopmentRefForwardingFunction);
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import type { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
export declare const VideoForRendering: ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>, "onEnded" | "autoPlay" | "controls" | "loop"> & {
|
|
4
|
+
volume?: import("../volume-prop").VolumeProp | undefined;
|
|
5
|
+
playbackRate?: number | undefined;
|
|
6
|
+
} & RefAttributes<HTMLVideoElement>>;
|
|
@@ -10,13 +10,14 @@ const delay_render_1 = require("../delay-render");
|
|
|
10
10
|
const is_approximately_the_same_1 = require("../is-approximately-the-same");
|
|
11
11
|
const random_1 = require("../random");
|
|
12
12
|
const Sequence_1 = require("../Sequence");
|
|
13
|
+
const timeline_position_state_1 = require("../timeline-position-state");
|
|
13
14
|
const use_current_frame_1 = require("../use-current-frame");
|
|
14
15
|
const use_unsafe_video_config_1 = require("../use-unsafe-video-config");
|
|
15
16
|
const volume_prop_1 = require("../volume-prop");
|
|
16
17
|
const warn_about_non_seekable_media_1 = require("../warn-about-non-seekable-media");
|
|
17
18
|
const get_current_time_1 = require("./get-current-time");
|
|
18
19
|
const VideoForRenderingForwardFunction = ({ onError, volume: volumeProp, playbackRate, ...props }, ref) => {
|
|
19
|
-
const absoluteFrame = (0,
|
|
20
|
+
const absoluteFrame = (0, timeline_position_state_1.useTimelinePosition)();
|
|
20
21
|
const frame = (0, use_current_frame_1.useCurrentFrame)();
|
|
21
22
|
const volumePropsFrame = (0, use_audio_frame_1.useFrameForVolumeProp)();
|
|
22
23
|
const videoConfig = (0, use_unsafe_video_config_1.useUnsafeVideoConfig)();
|
|
@@ -138,7 +139,7 @@ const VideoForRenderingForwardFunction = ({ onError, volume: volumeProp, playbac
|
|
|
138
139
|
var _a;
|
|
139
140
|
if (current === null || current === void 0 ? void 0 : current.error) {
|
|
140
141
|
console.error('Error occurred in video', current === null || current === void 0 ? void 0 : current.error);
|
|
141
|
-
throw new Error(`The browser threw an error while playing the video: Code ${current.error.code} - ${(_a = current === null || current === void 0 ? void 0 : current.error) === null || _a === void 0 ? void 0 : _a.message}. See https://remotion.dev/docs/media-playback-error for help`);
|
|
142
|
+
throw new Error(`The browser threw an error while playing the video ${props.src}: Code ${current.error.code} - ${(_a = current === null || current === void 0 ? void 0 : current.error) === null || _a === void 0 ? void 0 : _a.message}. See https://remotion.dev/docs/media-playback-error for help`);
|
|
142
143
|
}
|
|
143
144
|
else {
|
|
144
145
|
throw new Error('The browser threw an error');
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const path = require('node:path');
|
|
2
|
+
const fs = require('node:fs');
|
|
3
|
+
const cp = require('node:child_process');
|
|
4
|
+
|
|
5
|
+
const packageJson = JSON.parse(fs.readFileSync('package.json'));
|
|
6
|
+
const {version} = packageJson;
|
|
7
|
+
const src =
|
|
8
|
+
`
|
|
9
|
+
// Automatically generated on publish
|
|
10
|
+
export const VERSION = '${version}';
|
|
11
|
+
`.trim() + '\n';
|
|
12
|
+
|
|
13
|
+
fs.writeFileSync(path.resolve(process.cwd(), 'src/version.ts'), src);
|
|
14
|
+
|
|
15
|
+
cp.execSync('npx tsc');
|
|
16
|
+
|
|
17
|
+
const distFile = fs.readFileSync('dist/version.js', 'utf-8');
|
|
18
|
+
|
|
19
|
+
if (!distFile.includes(version)) {
|
|
20
|
+
console.log('In dist file, did not include version');
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
console.log('Updated version to v' + version);
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "remotion",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.6",
|
|
4
4
|
"description": "Render videos in React",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"sideEffects": false,
|
|
8
8
|
"scripts": {
|
|
9
|
+
"prepublish": "node ensure-correct-version.js && cp ../../README.md .",
|
|
9
10
|
"lint": "eslint src --ext ts,tsx",
|
|
10
11
|
"test": "vitest --run",
|
|
11
12
|
"build": "tsc -d",
|
|
12
|
-
"watch": "tsc -w"
|
|
13
|
-
"prerelease": "cp ../../README.md ."
|
|
13
|
+
"watch": "tsc -w"
|
|
14
14
|
},
|
|
15
15
|
"repository": {
|
|
16
16
|
"url": "https://github.com/remotion-dev/remotion"
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "9ecc20c6e7cea22c6a011b60d618ae42349ea19d"
|
|
58
58
|
}
|
package/version.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/version';
|
package/version.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./dist/version');
|