remotion 4.0.243 → 4.0.244
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/dist/cjs/audio/AudioForPreview.js +0 -3
- package/dist/cjs/use-sync-volume-with-media-tag.d.ts +1 -2
- package/dist/cjs/use-sync-volume-with-media-tag.js +23 -5
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/video/VideoForPreview.js +0 -3
- package/dist/esm/index.mjs +101 -114
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
|
@@ -9,7 +9,6 @@ const prefetch_js_1 = require("../prefetch.js");
|
|
|
9
9
|
const random_js_1 = require("../random.js");
|
|
10
10
|
const use_media_in_timeline_js_1 = require("../use-media-in-timeline.js");
|
|
11
11
|
const use_media_playback_js_1 = require("../use-media-playback.js");
|
|
12
|
-
const use_media_tag_volume_js_1 = require("../use-media-tag-volume.js");
|
|
13
12
|
const use_sync_volume_with_media_tag_js_1 = require("../use-sync-volume-with-media-tag.js");
|
|
14
13
|
const volume_position_state_js_1 = require("../volume-position-state.js");
|
|
15
14
|
const volume_prop_js_1 = require("../volume-prop.js");
|
|
@@ -66,10 +65,8 @@ const AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
66
65
|
props.loop,
|
|
67
66
|
]);
|
|
68
67
|
const audioRef = (0, shared_audio_tags_js_1.useSharedAudio)(propsToPass, id).el;
|
|
69
|
-
const actualVolume = (0, use_media_tag_volume_js_1.useMediaTagVolume)(audioRef);
|
|
70
68
|
(0, use_sync_volume_with_media_tag_js_1.useSyncVolumeWithMediaTag)({
|
|
71
69
|
volumePropFrame,
|
|
72
|
-
actualVolume,
|
|
73
70
|
volume,
|
|
74
71
|
mediaVolume,
|
|
75
72
|
mediaRef: audioRef,
|
|
@@ -2,9 +2,8 @@ import type { RefObject } from 'react';
|
|
|
2
2
|
import type { VolumeProp } from './volume-prop.js';
|
|
3
3
|
export type UseSyncVolumeWithMediaTagOptions = {
|
|
4
4
|
volumePropFrame: number;
|
|
5
|
-
actualVolume: number;
|
|
6
5
|
volume?: VolumeProp;
|
|
7
6
|
mediaVolume: number;
|
|
8
7
|
mediaRef: RefObject<HTMLVideoElement | HTMLAudioElement | null>;
|
|
9
8
|
};
|
|
10
|
-
export declare const useSyncVolumeWithMediaTag: ({ volumePropFrame,
|
|
9
|
+
export declare const useSyncVolumeWithMediaTag: ({ volumePropFrame, volume, mediaVolume, mediaRef, }: UseSyncVolumeWithMediaTagOptions) => void;
|
|
@@ -4,18 +4,36 @@ exports.useSyncVolumeWithMediaTag = void 0;
|
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const is_approximately_the_same_js_1 = require("./is-approximately-the-same.js");
|
|
6
6
|
const volume_prop_js_1 = require("./volume-prop.js");
|
|
7
|
-
const useSyncVolumeWithMediaTag = ({ volumePropFrame,
|
|
8
|
-
(0, react_1.
|
|
7
|
+
const useSyncVolumeWithMediaTag = ({ volumePropFrame, volume, mediaVolume, mediaRef, }) => {
|
|
8
|
+
const adjustVolume = (0, react_1.useCallback)(() => {
|
|
9
|
+
if (!mediaRef.current) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
9
12
|
const userPreferredVolume = (0, volume_prop_js_1.evaluateVolume)({
|
|
10
13
|
frame: volumePropFrame,
|
|
11
14
|
volume,
|
|
12
15
|
mediaVolume,
|
|
13
16
|
allowAmplificationDuringRender: false,
|
|
14
17
|
});
|
|
15
|
-
if (!(0, is_approximately_the_same_js_1.isApproximatelyTheSame)(userPreferredVolume,
|
|
16
|
-
mediaRef.current) {
|
|
18
|
+
if (!(0, is_approximately_the_same_js_1.isApproximatelyTheSame)(userPreferredVolume, mediaRef.current.volume)) {
|
|
17
19
|
mediaRef.current.volume = userPreferredVolume;
|
|
18
20
|
}
|
|
19
|
-
}, [
|
|
21
|
+
}, [mediaRef, mediaVolume, volume, volumePropFrame]);
|
|
22
|
+
(0, react_1.useEffect)(() => {
|
|
23
|
+
adjustVolume();
|
|
24
|
+
}, [adjustVolume]);
|
|
25
|
+
(0, react_1.useEffect)(() => {
|
|
26
|
+
const media = mediaRef.current;
|
|
27
|
+
if (!media) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const handleVolumeChange = () => {
|
|
31
|
+
adjustVolume();
|
|
32
|
+
};
|
|
33
|
+
media.addEventListener('volumechange', handleVolumeChange);
|
|
34
|
+
return () => {
|
|
35
|
+
media.removeEventListener('volumechange', handleVolumeChange);
|
|
36
|
+
};
|
|
37
|
+
}, [adjustVolume, mediaRef]);
|
|
20
38
|
};
|
|
21
39
|
exports.useSyncVolumeWithMediaTag = useSyncVolumeWithMediaTag;
|
package/dist/cjs/version.d.ts
CHANGED
package/dist/cjs/version.js
CHANGED
|
@@ -9,7 +9,6 @@ const use_audio_frame_js_1 = require("../audio/use-audio-frame.js");
|
|
|
9
9
|
const prefetch_js_1 = require("../prefetch.js");
|
|
10
10
|
const use_media_in_timeline_js_1 = require("../use-media-in-timeline.js");
|
|
11
11
|
const use_media_playback_js_1 = require("../use-media-playback.js");
|
|
12
|
-
const use_media_tag_volume_js_1 = require("../use-media-tag-volume.js");
|
|
13
12
|
const use_sync_volume_with_media_tag_js_1 = require("../use-sync-volume-with-media-tag.js");
|
|
14
13
|
const use_video_config_js_1 = require("../use-video-config.js");
|
|
15
14
|
const volume_position_state_js_1 = require("../volume-position-state.js");
|
|
@@ -30,7 +29,6 @@ const VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
|
30
29
|
if (typeof acceptableTimeShift !== 'undefined') {
|
|
31
30
|
throw new Error('acceptableTimeShift has been removed. Use acceptableTimeShiftInSeconds instead.');
|
|
32
31
|
}
|
|
33
|
-
const actualVolume = (0, use_media_tag_volume_js_1.useMediaTagVolume)(videoRef);
|
|
34
32
|
const [mediaVolume] = (0, volume_position_state_js_1.useMediaVolumeState)();
|
|
35
33
|
const [mediaMuted] = (0, volume_position_state_js_1.useMediaMutedState)();
|
|
36
34
|
(0, use_media_in_timeline_js_1.useMediaInTimeline)({
|
|
@@ -50,7 +48,6 @@ const VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
|
50
48
|
});
|
|
51
49
|
(0, use_sync_volume_with_media_tag_js_1.useSyncVolumeWithMediaTag)({
|
|
52
50
|
volumePropFrame,
|
|
53
|
-
actualVolume,
|
|
54
51
|
volume,
|
|
55
52
|
mediaVolume,
|
|
56
53
|
mediaRef: videoRef,
|
package/dist/esm/index.mjs
CHANGED
|
@@ -104,7 +104,7 @@ function truthy(value) {
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
// src/version.ts
|
|
107
|
-
var VERSION = "4.0.
|
|
107
|
+
var VERSION = "4.0.244";
|
|
108
108
|
|
|
109
109
|
// src/multiple-versions-warning.ts
|
|
110
110
|
var checkMultipleRemotionVersions = () => {
|
|
@@ -1601,7 +1601,7 @@ var Artifact = ({ filename, content }) => {
|
|
|
1601
1601
|
return null;
|
|
1602
1602
|
};
|
|
1603
1603
|
// src/audio/Audio.tsx
|
|
1604
|
-
import { forwardRef as forwardRef5, useCallback as
|
|
1604
|
+
import { forwardRef as forwardRef5, useCallback as useCallback10, useContext as useContext21 } from "react";
|
|
1605
1605
|
|
|
1606
1606
|
// src/absolute-src.ts
|
|
1607
1607
|
var getAbsoluteSrc = (relativeSrc) => {
|
|
@@ -1993,11 +1993,11 @@ var DurationsContextProvider = ({ children }) => {
|
|
|
1993
1993
|
import {
|
|
1994
1994
|
forwardRef as forwardRef3,
|
|
1995
1995
|
useContext as useContext19,
|
|
1996
|
-
useEffect as
|
|
1996
|
+
useEffect as useEffect13,
|
|
1997
1997
|
useImperativeHandle as useImperativeHandle3,
|
|
1998
1998
|
useMemo as useMemo19,
|
|
1999
1999
|
useRef as useRef8,
|
|
2000
|
-
useState as
|
|
2000
|
+
useState as useState12
|
|
2001
2001
|
} from "react";
|
|
2002
2002
|
|
|
2003
2003
|
// src/random.ts
|
|
@@ -3032,35 +3032,8 @@ var useMediaPlayback = ({
|
|
|
3032
3032
|
]);
|
|
3033
3033
|
};
|
|
3034
3034
|
|
|
3035
|
-
// src/use-media-tag-volume.ts
|
|
3036
|
-
import { useEffect as useEffect11, useState as useState11 } from "react";
|
|
3037
|
-
var useMediaTagVolume = (mediaRef) => {
|
|
3038
|
-
const [actualVolume, setActualVolume] = useState11(1);
|
|
3039
|
-
useEffect11(() => {
|
|
3040
|
-
const ref = mediaRef.current;
|
|
3041
|
-
if (!ref) {
|
|
3042
|
-
return;
|
|
3043
|
-
}
|
|
3044
|
-
const onChange = () => {
|
|
3045
|
-
setActualVolume(ref.volume);
|
|
3046
|
-
};
|
|
3047
|
-
ref.addEventListener("volumechange", onChange);
|
|
3048
|
-
return () => ref.removeEventListener("volumechange", onChange);
|
|
3049
|
-
}, [mediaRef]);
|
|
3050
|
-
useEffect11(() => {
|
|
3051
|
-
const ref = mediaRef.current;
|
|
3052
|
-
if (!ref) {
|
|
3053
|
-
return;
|
|
3054
|
-
}
|
|
3055
|
-
if (ref.volume !== actualVolume) {
|
|
3056
|
-
setActualVolume(ref.volume);
|
|
3057
|
-
}
|
|
3058
|
-
}, [actualVolume, mediaRef]);
|
|
3059
|
-
return actualVolume;
|
|
3060
|
-
};
|
|
3061
|
-
|
|
3062
3035
|
// src/use-sync-volume-with-media-tag.ts
|
|
3063
|
-
import { useEffect as
|
|
3036
|
+
import { useCallback as useCallback8, useEffect as useEffect11 } from "react";
|
|
3064
3037
|
|
|
3065
3038
|
// src/is-approximately-the-same.ts
|
|
3066
3039
|
var FLOATING_POINT_ERROR_THRESHOLD = 0.00001;
|
|
@@ -3071,22 +3044,40 @@ var isApproximatelyTheSame = (num1, num2) => {
|
|
|
3071
3044
|
// src/use-sync-volume-with-media-tag.ts
|
|
3072
3045
|
var useSyncVolumeWithMediaTag = ({
|
|
3073
3046
|
volumePropFrame,
|
|
3074
|
-
actualVolume,
|
|
3075
3047
|
volume,
|
|
3076
3048
|
mediaVolume,
|
|
3077
3049
|
mediaRef
|
|
3078
3050
|
}) => {
|
|
3079
|
-
|
|
3051
|
+
const adjustVolume = useCallback8(() => {
|
|
3052
|
+
if (!mediaRef.current) {
|
|
3053
|
+
return;
|
|
3054
|
+
}
|
|
3080
3055
|
const userPreferredVolume = evaluateVolume({
|
|
3081
3056
|
frame: volumePropFrame,
|
|
3082
3057
|
volume,
|
|
3083
3058
|
mediaVolume,
|
|
3084
3059
|
allowAmplificationDuringRender: false
|
|
3085
3060
|
});
|
|
3086
|
-
if (!isApproximatelyTheSame(userPreferredVolume,
|
|
3061
|
+
if (!isApproximatelyTheSame(userPreferredVolume, mediaRef.current.volume)) {
|
|
3087
3062
|
mediaRef.current.volume = userPreferredVolume;
|
|
3088
3063
|
}
|
|
3089
|
-
}, [
|
|
3064
|
+
}, [mediaRef, mediaVolume, volume, volumePropFrame]);
|
|
3065
|
+
useEffect11(() => {
|
|
3066
|
+
adjustVolume();
|
|
3067
|
+
}, [adjustVolume]);
|
|
3068
|
+
useEffect11(() => {
|
|
3069
|
+
const media = mediaRef.current;
|
|
3070
|
+
if (!media) {
|
|
3071
|
+
return;
|
|
3072
|
+
}
|
|
3073
|
+
const handleVolumeChange = () => {
|
|
3074
|
+
adjustVolume();
|
|
3075
|
+
};
|
|
3076
|
+
media.addEventListener("volumechange", handleVolumeChange);
|
|
3077
|
+
return () => {
|
|
3078
|
+
media.removeEventListener("volumechange", handleVolumeChange);
|
|
3079
|
+
};
|
|
3080
|
+
}, [adjustVolume, mediaRef]);
|
|
3090
3081
|
};
|
|
3091
3082
|
|
|
3092
3083
|
// src/volume-position-state.ts
|
|
@@ -3122,12 +3113,12 @@ var useMediaMutedState = () => {
|
|
|
3122
3113
|
import React12, {
|
|
3123
3114
|
createContext as createContext15,
|
|
3124
3115
|
createRef as createRef2,
|
|
3125
|
-
useCallback as
|
|
3116
|
+
useCallback as useCallback9,
|
|
3126
3117
|
useContext as useContext18,
|
|
3127
|
-
useEffect as
|
|
3118
|
+
useEffect as useEffect12,
|
|
3128
3119
|
useMemo as useMemo18,
|
|
3129
3120
|
useRef as useRef7,
|
|
3130
|
-
useState as
|
|
3121
|
+
useState as useState11
|
|
3131
3122
|
} from "react";
|
|
3132
3123
|
import { jsx as jsx14, jsxs } from "react/jsx-runtime";
|
|
3133
3124
|
var EMPTY_AUDIO = "data:audio/mp3;base64,/+MYxAAJcAV8AAgAABn//////+/gQ5BAMA+D4Pg+BAQBAEAwD4Pg+D4EBAEAQDAPg++hYBH///hUFQVBUFREDQNHmf///////+MYxBUGkAGIMAAAAP/29Xt6lUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV/+MYxDUAAANIAAAAAFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV";
|
|
@@ -3159,7 +3150,7 @@ var didPropChange = (key, newProp, prevProp) => {
|
|
|
3159
3150
|
var SharedAudioContext = createContext15(null);
|
|
3160
3151
|
var SharedAudioContextProvider = ({ children, numberOfAudioTags, component }) => {
|
|
3161
3152
|
const audios = useRef7([]);
|
|
3162
|
-
const [initialNumberOfAudioTags] =
|
|
3153
|
+
const [initialNumberOfAudioTags] = useState11(numberOfAudioTags);
|
|
3163
3154
|
if (numberOfAudioTags !== initialNumberOfAudioTags) {
|
|
3164
3155
|
throw new Error("The number of shared audio tags has changed dynamically. Once you have set this property, you cannot change it afterwards.");
|
|
3165
3156
|
}
|
|
@@ -3169,7 +3160,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, component }) =>
|
|
|
3169
3160
|
});
|
|
3170
3161
|
}, [numberOfAudioTags]);
|
|
3171
3162
|
const takenAudios = useRef7(new Array(numberOfAudioTags).fill(false));
|
|
3172
|
-
const rerenderAudios =
|
|
3163
|
+
const rerenderAudios = useCallback9(() => {
|
|
3173
3164
|
refs.forEach(({ ref, id }) => {
|
|
3174
3165
|
const data = audios.current?.find((a) => a.id === id);
|
|
3175
3166
|
const { current } = ref;
|
|
@@ -3190,7 +3181,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, component }) =>
|
|
|
3190
3181
|
});
|
|
3191
3182
|
});
|
|
3192
3183
|
}, [refs]);
|
|
3193
|
-
const registerAudio =
|
|
3184
|
+
const registerAudio = useCallback9((aud, audioId) => {
|
|
3194
3185
|
const found = audios.current?.find((a) => a.audioId === audioId);
|
|
3195
3186
|
if (found) {
|
|
3196
3187
|
return found;
|
|
@@ -3213,7 +3204,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, component }) =>
|
|
|
3213
3204
|
rerenderAudios();
|
|
3214
3205
|
return newElem;
|
|
3215
3206
|
}, [numberOfAudioTags, refs, rerenderAudios]);
|
|
3216
|
-
const unregisterAudio =
|
|
3207
|
+
const unregisterAudio = useCallback9((id) => {
|
|
3217
3208
|
const cloned = [...takenAudios.current];
|
|
3218
3209
|
const index = refs.findIndex((r) => r.id === id);
|
|
3219
3210
|
if (index === -1) {
|
|
@@ -3224,7 +3215,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, component }) =>
|
|
|
3224
3215
|
audios.current = audios.current?.filter((a) => a.id !== id);
|
|
3225
3216
|
rerenderAudios();
|
|
3226
3217
|
}, [refs, rerenderAudios]);
|
|
3227
|
-
const updateAudio =
|
|
3218
|
+
const updateAudio = useCallback9(({
|
|
3228
3219
|
aud,
|
|
3229
3220
|
audioId,
|
|
3230
3221
|
id
|
|
@@ -3249,7 +3240,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, component }) =>
|
|
|
3249
3240
|
rerenderAudios();
|
|
3250
3241
|
}
|
|
3251
3242
|
}, [rerenderAudios]);
|
|
3252
|
-
const playAllAudios =
|
|
3243
|
+
const playAllAudios = useCallback9(() => {
|
|
3253
3244
|
refs.forEach((ref) => {
|
|
3254
3245
|
playAndHandleNotAllowedError(ref.ref, "audio", null);
|
|
3255
3246
|
});
|
|
@@ -3269,12 +3260,12 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, component }) =>
|
|
|
3269
3260
|
unregisterAudio,
|
|
3270
3261
|
updateAudio
|
|
3271
3262
|
]);
|
|
3272
|
-
const resetAudio =
|
|
3263
|
+
const resetAudio = useCallback9(() => {
|
|
3273
3264
|
takenAudios.current = new Array(numberOfAudioTags).fill(false);
|
|
3274
3265
|
audios.current = [];
|
|
3275
3266
|
rerenderAudios();
|
|
3276
3267
|
}, [numberOfAudioTags, rerenderAudios]);
|
|
3277
|
-
|
|
3268
|
+
useEffect12(() => {
|
|
3278
3269
|
return () => {
|
|
3279
3270
|
resetAudio();
|
|
3280
3271
|
};
|
|
@@ -3295,7 +3286,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, component }) =>
|
|
|
3295
3286
|
};
|
|
3296
3287
|
var useSharedAudio = (aud, audioId) => {
|
|
3297
3288
|
const ctx = useContext18(SharedAudioContext);
|
|
3298
|
-
const [elem] =
|
|
3289
|
+
const [elem] = useState11(() => {
|
|
3299
3290
|
if (ctx && ctx.numberOfAudioTags > 0) {
|
|
3300
3291
|
return ctx.registerAudio(aud, audioId);
|
|
3301
3292
|
}
|
|
@@ -3327,7 +3318,7 @@ var useSharedAudio = (aud, audioId) => {
|
|
|
3327
3318
|
// src/audio/AudioForPreview.tsx
|
|
3328
3319
|
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
3329
3320
|
var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
3330
|
-
const [initialShouldPreMountAudioElements] =
|
|
3321
|
+
const [initialShouldPreMountAudioElements] = useState12(props.shouldPreMountAudioTags);
|
|
3331
3322
|
if (props.shouldPreMountAudioTags !== initialShouldPreMountAudioElements) {
|
|
3332
3323
|
throw new Error("Cannot change the behavior for pre-mounting audio tags dynamically.");
|
|
3333
3324
|
}
|
|
@@ -3360,7 +3351,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
3360
3351
|
}
|
|
3361
3352
|
const preloadedSrc = usePreload(src);
|
|
3362
3353
|
const sequenceContext = useContext19(SequenceContext);
|
|
3363
|
-
const [timelineId] =
|
|
3354
|
+
const [timelineId] = useState12(() => String(Math.random()));
|
|
3364
3355
|
const isSequenceHidden = hidden[timelineId] ?? false;
|
|
3365
3356
|
const userPreferredVolume = evaluateVolume({
|
|
3366
3357
|
frame: volumePropFrame,
|
|
@@ -3393,10 +3384,8 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
3393
3384
|
props.loop
|
|
3394
3385
|
]);
|
|
3395
3386
|
const audioRef = useSharedAudio(propsToPass, id).el;
|
|
3396
|
-
const actualVolume = useMediaTagVolume(audioRef);
|
|
3397
3387
|
useSyncVolumeWithMediaTag({
|
|
3398
3388
|
volumePropFrame,
|
|
3399
|
-
actualVolume,
|
|
3400
3389
|
volume,
|
|
3401
3390
|
mediaVolume,
|
|
3402
3391
|
mediaRef: audioRef
|
|
@@ -3433,7 +3422,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
3433
3422
|
}, [audioRef]);
|
|
3434
3423
|
const currentOnDurationCallback = useRef8(onDuration);
|
|
3435
3424
|
currentOnDurationCallback.current = onDuration;
|
|
3436
|
-
|
|
3425
|
+
useEffect13(() => {
|
|
3437
3426
|
const { current } = audioRef;
|
|
3438
3427
|
if (!current) {
|
|
3439
3428
|
return;
|
|
@@ -3465,7 +3454,7 @@ var AudioForPreview = forwardRef3(AudioForDevelopmentForwardRefFunction);
|
|
|
3465
3454
|
import {
|
|
3466
3455
|
forwardRef as forwardRef4,
|
|
3467
3456
|
useContext as useContext20,
|
|
3468
|
-
useEffect as
|
|
3457
|
+
useEffect as useEffect14,
|
|
3469
3458
|
useImperativeHandle as useImperativeHandle4,
|
|
3470
3459
|
useLayoutEffect as useLayoutEffect2,
|
|
3471
3460
|
useMemo as useMemo20,
|
|
@@ -3580,7 +3569,7 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
3580
3569
|
useImperativeHandle4(ref, () => {
|
|
3581
3570
|
return audioRef.current;
|
|
3582
3571
|
}, []);
|
|
3583
|
-
|
|
3572
|
+
useEffect14(() => {
|
|
3584
3573
|
if (!props.src) {
|
|
3585
3574
|
throw new Error("No src passed");
|
|
3586
3575
|
}
|
|
@@ -3691,7 +3680,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
3691
3680
|
throw new TypeError(`The \`<Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
|
|
3692
3681
|
}
|
|
3693
3682
|
const preloadedSrc = usePreload(props.src);
|
|
3694
|
-
const onError =
|
|
3683
|
+
const onError = useCallback10((e) => {
|
|
3695
3684
|
console.log(e.currentTarget.error);
|
|
3696
3685
|
const errMessage = `Could not play audio with src ${preloadedSrc}: ${e.currentTarget.error}. See https://remotion.dev/docs/media-playback-error for help.`;
|
|
3697
3686
|
if (loop) {
|
|
@@ -3700,7 +3689,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
3700
3689
|
console.warn(errMessage);
|
|
3701
3690
|
}
|
|
3702
3691
|
}, [loop, preloadedSrc]);
|
|
3703
|
-
const onDuration =
|
|
3692
|
+
const onDuration = useCallback10((src, durationInSeconds) => {
|
|
3704
3693
|
setDurations({ type: "got-duration", durationInSeconds, src });
|
|
3705
3694
|
}, [setDurations]);
|
|
3706
3695
|
const durationFetched = durations[getAbsoluteSrc(preloadedSrc)] ?? durations[getAbsoluteSrc(props.src)];
|
|
@@ -3773,11 +3762,11 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
3773
3762
|
var Audio = forwardRef5(AudioRefForwardingFunction);
|
|
3774
3763
|
addSequenceStackTraces(Audio);
|
|
3775
3764
|
// src/Composition.tsx
|
|
3776
|
-
import { Suspense, useContext as useContext23, useEffect as
|
|
3765
|
+
import { Suspense, useContext as useContext23, useEffect as useEffect16 } from "react";
|
|
3777
3766
|
import { createPortal } from "react-dom";
|
|
3778
3767
|
|
|
3779
3768
|
// src/Folder.tsx
|
|
3780
|
-
import { createContext as createContext16, useContext as useContext22, useEffect as
|
|
3769
|
+
import { createContext as createContext16, useContext as useContext22, useEffect as useEffect15, useMemo as useMemo21 } from "react";
|
|
3781
3770
|
|
|
3782
3771
|
// src/validation/validate-folder-name.ts
|
|
3783
3772
|
var getRegex = () => /^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g;
|
|
@@ -3813,7 +3802,7 @@ var Folder = ({ name, children }) => {
|
|
|
3813
3802
|
parentName
|
|
3814
3803
|
};
|
|
3815
3804
|
}, [name, parentName]);
|
|
3816
|
-
|
|
3805
|
+
useEffect15(() => {
|
|
3817
3806
|
registerFolder(name, parentName);
|
|
3818
3807
|
return () => {
|
|
3819
3808
|
unregisterFolder(name, parentName);
|
|
@@ -3957,7 +3946,7 @@ var validateDefaultAndInputProps = (defaultProps, name, compositionId) => {
|
|
|
3957
3946
|
// src/Composition.tsx
|
|
3958
3947
|
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
3959
3948
|
var Fallback = () => {
|
|
3960
|
-
|
|
3949
|
+
useEffect16(() => {
|
|
3961
3950
|
const fallback = delayRender("Waiting for Root component to unsuspend");
|
|
3962
3951
|
return () => continueRender(fallback);
|
|
3963
3952
|
}, []);
|
|
@@ -3987,7 +3976,7 @@ var Composition = ({
|
|
|
3987
3976
|
throw new Error("<Composition> mounted inside another composition. See https://remotion.dev/docs/wrong-composition-mount for help.");
|
|
3988
3977
|
}
|
|
3989
3978
|
const { folderName, parentName } = useContext23(FolderContext);
|
|
3990
|
-
|
|
3979
|
+
useEffect16(() => {
|
|
3991
3980
|
if (!id) {
|
|
3992
3981
|
throw new Error("No id for composition passed.");
|
|
3993
3982
|
}
|
|
@@ -4059,28 +4048,28 @@ var Composition = ({
|
|
|
4059
4048
|
};
|
|
4060
4049
|
// src/CompositionManager.tsx
|
|
4061
4050
|
import React18, {
|
|
4062
|
-
useCallback as
|
|
4051
|
+
useCallback as useCallback11,
|
|
4063
4052
|
useImperativeHandle as useImperativeHandle5,
|
|
4064
4053
|
useMemo as useMemo23,
|
|
4065
4054
|
useRef as useRef10,
|
|
4066
|
-
useState as
|
|
4055
|
+
useState as useState13
|
|
4067
4056
|
} from "react";
|
|
4068
4057
|
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
4069
4058
|
var compositionsRef = React18.createRef();
|
|
4070
4059
|
var CompositionManagerProvider = ({ children, numberOfAudioTags }) => {
|
|
4071
|
-
const [compositions, setCompositions] =
|
|
4060
|
+
const [compositions, setCompositions] = useState13([]);
|
|
4072
4061
|
const currentcompositionsRef = useRef10(compositions);
|
|
4073
|
-
const [folders, setFolders] =
|
|
4074
|
-
const [canvasContent, setCanvasContent] =
|
|
4075
|
-
const [currentCompositionMetadata, setCurrentCompositionMetadata] =
|
|
4076
|
-
const updateCompositions =
|
|
4062
|
+
const [folders, setFolders] = useState13([]);
|
|
4063
|
+
const [canvasContent, setCanvasContent] = useState13(null);
|
|
4064
|
+
const [currentCompositionMetadata, setCurrentCompositionMetadata] = useState13(null);
|
|
4065
|
+
const updateCompositions = useCallback11((updateComps) => {
|
|
4077
4066
|
setCompositions((comps) => {
|
|
4078
4067
|
const updated = updateComps(comps);
|
|
4079
4068
|
currentcompositionsRef.current = updated;
|
|
4080
4069
|
return updated;
|
|
4081
4070
|
});
|
|
4082
4071
|
}, []);
|
|
4083
|
-
const registerComposition =
|
|
4072
|
+
const registerComposition = useCallback11((comp) => {
|
|
4084
4073
|
updateCompositions((comps) => {
|
|
4085
4074
|
if (comps.find((c) => c.id === comp.id)) {
|
|
4086
4075
|
throw new Error(`Multiple composition with id ${comp.id} are registered.`);
|
|
@@ -4089,12 +4078,12 @@ var CompositionManagerProvider = ({ children, numberOfAudioTags }) => {
|
|
|
4089
4078
|
return value;
|
|
4090
4079
|
});
|
|
4091
4080
|
}, [updateCompositions]);
|
|
4092
|
-
const unregisterComposition =
|
|
4081
|
+
const unregisterComposition = useCallback11((id) => {
|
|
4093
4082
|
setCompositions((comps) => {
|
|
4094
4083
|
return comps.filter((c) => c.id !== id);
|
|
4095
4084
|
});
|
|
4096
4085
|
}, []);
|
|
4097
|
-
const registerFolder =
|
|
4086
|
+
const registerFolder = useCallback11((name, parent) => {
|
|
4098
4087
|
setFolders((prevFolders) => {
|
|
4099
4088
|
return [
|
|
4100
4089
|
...prevFolders,
|
|
@@ -4105,7 +4094,7 @@ var CompositionManagerProvider = ({ children, numberOfAudioTags }) => {
|
|
|
4105
4094
|
];
|
|
4106
4095
|
});
|
|
4107
4096
|
}, []);
|
|
4108
|
-
const unregisterFolder =
|
|
4097
|
+
const unregisterFolder = useCallback11((name, parent) => {
|
|
4109
4098
|
setFolders((prevFolders) => {
|
|
4110
4099
|
return prevFolders.filter((p) => !(p.name === name && p.parent === parent));
|
|
4111
4100
|
});
|
|
@@ -4116,7 +4105,7 @@ var CompositionManagerProvider = ({ children, numberOfAudioTags }) => {
|
|
|
4116
4105
|
};
|
|
4117
4106
|
}, []);
|
|
4118
4107
|
const composition = compositions.find((c) => canvasContent?.type === "composition" ? c.id === canvasContent.compositionId : null);
|
|
4119
|
-
const updateCompositionDefaultProps =
|
|
4108
|
+
const updateCompositionDefaultProps = useCallback11((id, newDefaultProps) => {
|
|
4120
4109
|
setCompositions((comps) => {
|
|
4121
4110
|
const updated = comps.map((c) => {
|
|
4122
4111
|
if (c.id === id) {
|
|
@@ -4384,7 +4373,7 @@ var getStaticFiles = () => {
|
|
|
4384
4373
|
return window.remotion_staticFiles;
|
|
4385
4374
|
};
|
|
4386
4375
|
// src/IFrame.tsx
|
|
4387
|
-
import { forwardRef as forwardRef6, useCallback as
|
|
4376
|
+
import { forwardRef as forwardRef6, useCallback as useCallback12, useState as useState14 } from "react";
|
|
4388
4377
|
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
4389
4378
|
var IFrameRefForwarding = ({
|
|
4390
4379
|
onLoad,
|
|
@@ -4393,15 +4382,15 @@ var IFrameRefForwarding = ({
|
|
|
4393
4382
|
delayRenderTimeoutInMilliseconds,
|
|
4394
4383
|
...props2
|
|
4395
4384
|
}, ref) => {
|
|
4396
|
-
const [handle] =
|
|
4385
|
+
const [handle] = useState14(() => delayRender(`Loading <IFrame> with source ${props2.src}`, {
|
|
4397
4386
|
retries: delayRenderRetries ?? undefined,
|
|
4398
4387
|
timeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? undefined
|
|
4399
4388
|
}));
|
|
4400
|
-
const didLoad =
|
|
4389
|
+
const didLoad = useCallback12((e) => {
|
|
4401
4390
|
continueRender(handle);
|
|
4402
4391
|
onLoad?.(e);
|
|
4403
4392
|
}, [handle, onLoad]);
|
|
4404
|
-
const didGetError =
|
|
4393
|
+
const didGetError = useCallback12((e) => {
|
|
4405
4394
|
continueRender(handle);
|
|
4406
4395
|
if (onError) {
|
|
4407
4396
|
onError(e);
|
|
@@ -4420,7 +4409,7 @@ var IFrame = forwardRef6(IFrameRefForwarding);
|
|
|
4420
4409
|
// src/Img.tsx
|
|
4421
4410
|
import {
|
|
4422
4411
|
forwardRef as forwardRef7,
|
|
4423
|
-
useCallback as
|
|
4412
|
+
useCallback as useCallback13,
|
|
4424
4413
|
useContext as useContext24,
|
|
4425
4414
|
useImperativeHandle as useImperativeHandle6,
|
|
4426
4415
|
useLayoutEffect as useLayoutEffect3,
|
|
@@ -4451,7 +4440,7 @@ var ImgRefForwarding = ({
|
|
|
4451
4440
|
return imageRef.current;
|
|
4452
4441
|
}, []);
|
|
4453
4442
|
const actualSrc = usePreload(src);
|
|
4454
|
-
const retryIn =
|
|
4443
|
+
const retryIn = useCallback13((timeout) => {
|
|
4455
4444
|
if (!imageRef.current) {
|
|
4456
4445
|
return;
|
|
4457
4446
|
}
|
|
@@ -4468,7 +4457,7 @@ var ImgRefForwarding = ({
|
|
|
4468
4457
|
imageRef.current.setAttribute("src", newSrc);
|
|
4469
4458
|
}, timeout);
|
|
4470
4459
|
}, []);
|
|
4471
|
-
const didGetError =
|
|
4460
|
+
const didGetError = useCallback13((e) => {
|
|
4472
4461
|
if (!errors.current) {
|
|
4473
4462
|
return;
|
|
4474
4463
|
}
|
|
@@ -4651,20 +4640,20 @@ var waitForRoot = (fn) => {
|
|
|
4651
4640
|
|
|
4652
4641
|
// src/RemotionRoot.tsx
|
|
4653
4642
|
import {
|
|
4654
|
-
useEffect as
|
|
4643
|
+
useEffect as useEffect17,
|
|
4655
4644
|
useLayoutEffect as useLayoutEffect4,
|
|
4656
4645
|
useMemo as useMemo24,
|
|
4657
4646
|
useRef as useRef12,
|
|
4658
|
-
useState as
|
|
4647
|
+
useState as useState15
|
|
4659
4648
|
} from "react";
|
|
4660
4649
|
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
4661
4650
|
var RemotionRoot = ({ children, numberOfAudioTags }) => {
|
|
4662
|
-
const [remotionRootId] =
|
|
4663
|
-
const [frame, setFrame] =
|
|
4664
|
-
const [playing, setPlaying] =
|
|
4651
|
+
const [remotionRootId] = useState15(() => String(random(null)));
|
|
4652
|
+
const [frame, setFrame] = useState15(() => getInitialFrameState());
|
|
4653
|
+
const [playing, setPlaying] = useState15(false);
|
|
4665
4654
|
const imperativePlaying = useRef12(false);
|
|
4666
|
-
const [fastRefreshes, setFastRefreshes] =
|
|
4667
|
-
const [playbackRate, setPlaybackRate] =
|
|
4655
|
+
const [fastRefreshes, setFastRefreshes] = useState15(0);
|
|
4656
|
+
const [playbackRate, setPlaybackRate] = useState15(1);
|
|
4668
4657
|
const audioAndVideoTags = useRef12([]);
|
|
4669
4658
|
if (typeof window !== "undefined") {
|
|
4670
4659
|
useLayoutEffect4(() => {
|
|
@@ -4716,7 +4705,7 @@ var RemotionRoot = ({ children, numberOfAudioTags }) => {
|
|
|
4716
4705
|
fastRefreshes
|
|
4717
4706
|
};
|
|
4718
4707
|
}, [fastRefreshes]);
|
|
4719
|
-
|
|
4708
|
+
useEffect17(() => {
|
|
4720
4709
|
if (typeof __webpack_module__ !== "undefined") {
|
|
4721
4710
|
if (__webpack_module__.hot) {
|
|
4722
4711
|
__webpack_module__.hot.addStatusHandler((status) => {
|
|
@@ -5748,16 +5737,16 @@ var Still = (props2) => {
|
|
|
5748
5737
|
return React27.createElement(Composition, newProps);
|
|
5749
5738
|
};
|
|
5750
5739
|
// src/video/OffthreadVideo.tsx
|
|
5751
|
-
import { useCallback as
|
|
5740
|
+
import { useCallback as useCallback15 } from "react";
|
|
5752
5741
|
|
|
5753
5742
|
// src/video/OffthreadVideoForRendering.tsx
|
|
5754
5743
|
import {
|
|
5755
|
-
useCallback as
|
|
5744
|
+
useCallback as useCallback14,
|
|
5756
5745
|
useContext as useContext25,
|
|
5757
|
-
useEffect as
|
|
5746
|
+
useEffect as useEffect18,
|
|
5758
5747
|
useLayoutEffect as useLayoutEffect5,
|
|
5759
5748
|
useMemo as useMemo27,
|
|
5760
|
-
useState as
|
|
5749
|
+
useState as useState16
|
|
5761
5750
|
} from "react";
|
|
5762
5751
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
5763
5752
|
var OffthreadVideoForRendering = ({
|
|
@@ -5803,7 +5792,7 @@ var OffthreadVideoForRendering = ({
|
|
|
5803
5792
|
mediaVolume: 1,
|
|
5804
5793
|
allowAmplificationDuringRender: allowAmplificationDuringRender ?? false
|
|
5805
5794
|
});
|
|
5806
|
-
|
|
5795
|
+
useEffect18(() => {
|
|
5807
5796
|
if (!src) {
|
|
5808
5797
|
throw new Error("No src passed");
|
|
5809
5798
|
}
|
|
@@ -5858,7 +5847,7 @@ var OffthreadVideoForRendering = ({
|
|
|
5858
5847
|
toneMapped
|
|
5859
5848
|
});
|
|
5860
5849
|
}, [toneMapped, currentTime, src, transparent]);
|
|
5861
|
-
const [imageSrc, setImageSrc] =
|
|
5850
|
+
const [imageSrc, setImageSrc] = useState16(null);
|
|
5862
5851
|
useLayoutEffect5(() => {
|
|
5863
5852
|
if (!window.remotion_videoEnabled) {
|
|
5864
5853
|
return;
|
|
@@ -5928,7 +5917,7 @@ var OffthreadVideoForRendering = ({
|
|
|
5928
5917
|
delayRenderTimeoutInMilliseconds,
|
|
5929
5918
|
onError
|
|
5930
5919
|
]);
|
|
5931
|
-
const onErr =
|
|
5920
|
+
const onErr = useCallback14(() => {
|
|
5932
5921
|
if (onError) {
|
|
5933
5922
|
onError?.(new Error("Failed to load image with src " + imageSrc));
|
|
5934
5923
|
} else {
|
|
@@ -5938,7 +5927,7 @@ var OffthreadVideoForRendering = ({
|
|
|
5938
5927
|
const className = useMemo27(() => {
|
|
5939
5928
|
return [OFFTHREAD_VIDEO_CLASS_NAME, props2.className].filter(truthy).join(" ");
|
|
5940
5929
|
}, [props2.className]);
|
|
5941
|
-
const onImageFrame =
|
|
5930
|
+
const onImageFrame = useCallback14((img) => {
|
|
5942
5931
|
if (onVideoFrame) {
|
|
5943
5932
|
onVideoFrame(img);
|
|
5944
5933
|
}
|
|
@@ -5962,20 +5951,20 @@ var OffthreadVideoForRendering = ({
|
|
|
5962
5951
|
import {
|
|
5963
5952
|
forwardRef as forwardRef9,
|
|
5964
5953
|
useContext as useContext26,
|
|
5965
|
-
useEffect as
|
|
5954
|
+
useEffect as useEffect20,
|
|
5966
5955
|
useImperativeHandle as useImperativeHandle7,
|
|
5967
5956
|
useMemo as useMemo28,
|
|
5968
5957
|
useRef as useRef13,
|
|
5969
|
-
useState as
|
|
5958
|
+
useState as useState17
|
|
5970
5959
|
} from "react";
|
|
5971
5960
|
|
|
5972
5961
|
// src/video/emit-video-frame.ts
|
|
5973
|
-
import { useEffect as
|
|
5962
|
+
import { useEffect as useEffect19 } from "react";
|
|
5974
5963
|
var useEmitVideoFrame = ({
|
|
5975
5964
|
ref,
|
|
5976
5965
|
onVideoFrame
|
|
5977
5966
|
}) => {
|
|
5978
|
-
|
|
5967
|
+
useEffect19(() => {
|
|
5979
5968
|
const { current } = ref;
|
|
5980
5969
|
if (!current) {
|
|
5981
5970
|
return;
|
|
@@ -6030,12 +6019,11 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
6030
6019
|
const { fps, durationInFrames } = useVideoConfig();
|
|
6031
6020
|
const parentSequence = useContext26(SequenceContext);
|
|
6032
6021
|
const { hidden } = useContext26(SequenceVisibilityToggleContext);
|
|
6033
|
-
const [timelineId] =
|
|
6022
|
+
const [timelineId] = useState17(() => String(Math.random()));
|
|
6034
6023
|
const isSequenceHidden = hidden[timelineId] ?? false;
|
|
6035
6024
|
if (typeof acceptableTimeShift !== "undefined") {
|
|
6036
6025
|
throw new Error("acceptableTimeShift has been removed. Use acceptableTimeShiftInSeconds instead.");
|
|
6037
6026
|
}
|
|
6038
|
-
const actualVolume = useMediaTagVolume(videoRef);
|
|
6039
6027
|
const [mediaVolume] = useMediaVolumeState();
|
|
6040
6028
|
const [mediaMuted] = useMediaMutedState();
|
|
6041
6029
|
useMediaInTimeline({
|
|
@@ -6055,7 +6043,6 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
6055
6043
|
});
|
|
6056
6044
|
useSyncVolumeWithMediaTag({
|
|
6057
6045
|
volumePropFrame,
|
|
6058
|
-
actualVolume,
|
|
6059
6046
|
volume,
|
|
6060
6047
|
mediaVolume,
|
|
6061
6048
|
mediaRef: videoRef
|
|
@@ -6083,7 +6070,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
6083
6070
|
useImperativeHandle7(ref, () => {
|
|
6084
6071
|
return videoRef.current;
|
|
6085
6072
|
}, []);
|
|
6086
|
-
|
|
6073
|
+
useEffect20(() => {
|
|
6087
6074
|
const { current } = videoRef;
|
|
6088
6075
|
if (!current) {
|
|
6089
6076
|
return;
|
|
@@ -6114,7 +6101,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
6114
6101
|
const currentOnDurationCallback = useRef13(onDuration);
|
|
6115
6102
|
currentOnDurationCallback.current = onDuration;
|
|
6116
6103
|
useEmitVideoFrame({ ref: videoRef, onVideoFrame });
|
|
6117
|
-
|
|
6104
|
+
useEffect20(() => {
|
|
6118
6105
|
const { current } = videoRef;
|
|
6119
6106
|
if (!current) {
|
|
6120
6107
|
return;
|
|
@@ -6131,7 +6118,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
6131
6118
|
current.removeEventListener("loadedmetadata", onLoadedMetadata);
|
|
6132
6119
|
};
|
|
6133
6120
|
}, [src]);
|
|
6134
|
-
|
|
6121
|
+
useEffect20(() => {
|
|
6135
6122
|
const { current } = videoRef;
|
|
6136
6123
|
if (!current) {
|
|
6137
6124
|
return;
|
|
@@ -6176,7 +6163,7 @@ var OffthreadVideo = (props2) => {
|
|
|
6176
6163
|
...otherProps
|
|
6177
6164
|
} = props2;
|
|
6178
6165
|
const environment = getRemotionEnvironment();
|
|
6179
|
-
const onDuration =
|
|
6166
|
+
const onDuration = useCallback15(() => {
|
|
6180
6167
|
return;
|
|
6181
6168
|
}, []);
|
|
6182
6169
|
if (typeof props2.src !== "string") {
|
|
@@ -6233,13 +6220,13 @@ var OffthreadVideo = (props2) => {
|
|
|
6233
6220
|
});
|
|
6234
6221
|
};
|
|
6235
6222
|
// src/video/Video.tsx
|
|
6236
|
-
import { forwardRef as forwardRef11, useCallback as
|
|
6223
|
+
import { forwardRef as forwardRef11, useCallback as useCallback16, useContext as useContext28 } from "react";
|
|
6237
6224
|
|
|
6238
6225
|
// src/video/VideoForRendering.tsx
|
|
6239
6226
|
import {
|
|
6240
6227
|
forwardRef as forwardRef10,
|
|
6241
6228
|
useContext as useContext27,
|
|
6242
|
-
useEffect as
|
|
6229
|
+
useEffect as useEffect21,
|
|
6243
6230
|
useImperativeHandle as useImperativeHandle8,
|
|
6244
6231
|
useLayoutEffect as useLayoutEffect6,
|
|
6245
6232
|
useMemo as useMemo29,
|
|
@@ -6380,7 +6367,7 @@ var VideoForRenderingForwardFunction = ({
|
|
|
6380
6367
|
mediaVolume: 1,
|
|
6381
6368
|
allowAmplificationDuringRender: allowAmplificationDuringRender ?? false
|
|
6382
6369
|
});
|
|
6383
|
-
|
|
6370
|
+
useEffect21(() => {
|
|
6384
6371
|
if (!props2.src) {
|
|
6385
6372
|
throw new Error("No src passed");
|
|
6386
6373
|
}
|
|
@@ -6423,7 +6410,7 @@ var VideoForRenderingForwardFunction = ({
|
|
|
6423
6410
|
useImperativeHandle8(ref, () => {
|
|
6424
6411
|
return videoRef.current;
|
|
6425
6412
|
}, []);
|
|
6426
|
-
|
|
6413
|
+
useEffect21(() => {
|
|
6427
6414
|
if (!window.remotion_videoEnabled) {
|
|
6428
6415
|
return;
|
|
6429
6416
|
}
|
|
@@ -6557,10 +6544,10 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
6557
6544
|
throw new TypeError(`The \`<Video>\` tag requires a string for \`src\`, but got ${JSON.stringify(props2.src)} instead.`);
|
|
6558
6545
|
}
|
|
6559
6546
|
const preloadedSrc = usePreload(props2.src);
|
|
6560
|
-
const onDuration =
|
|
6547
|
+
const onDuration = useCallback16((src, durationInSeconds) => {
|
|
6561
6548
|
setDurations({ type: "got-duration", durationInSeconds, src });
|
|
6562
6549
|
}, [setDurations]);
|
|
6563
|
-
const onVideoFrame =
|
|
6550
|
+
const onVideoFrame = useCallback16(() => {
|
|
6564
6551
|
}, []);
|
|
6565
6552
|
const durationFetched = durations[getAbsoluteSrc(preloadedSrc)] ?? durations[getAbsoluteSrc(props2.src)];
|
|
6566
6553
|
if (loop && durationFetched !== undefined) {
|
package/dist/esm/version.mjs
CHANGED
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/core"
|
|
4
4
|
},
|
|
5
5
|
"name": "remotion",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.244",
|
|
7
7
|
"description": "Make videos programmatically",
|
|
8
8
|
"main": "dist/cjs/index.js",
|
|
9
9
|
"types": "dist/cjs/index.d.ts",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"webpack": "5.96.1",
|
|
30
30
|
"zod": "3.22.3",
|
|
31
31
|
"eslint": "9.14.0",
|
|
32
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
32
|
+
"@remotion/eslint-config-internal": "4.0.244"
|
|
33
33
|
},
|
|
34
34
|
"keywords": [
|
|
35
35
|
"remotion",
|