remotion 4.0.38 → 4.0.39
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.
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useRemotionEnvironment = exports.getRemotionEnvironment = void 0;
|
|
4
|
+
const is_player_js_1 = require("./is-player.js");
|
|
5
|
+
const getRemotionEnvironment = () => {
|
|
6
|
+
if (process.env.NODE_ENV === 'production') {
|
|
7
|
+
if (typeof window !== 'undefined' && window.remotion_isPlayer) {
|
|
8
|
+
return 'player-production';
|
|
9
|
+
}
|
|
10
|
+
return 'rendering';
|
|
11
|
+
}
|
|
12
|
+
// The Vitest framework sets NODE_ENV as test.
|
|
13
|
+
// Right now we don't need to treat it in a special
|
|
14
|
+
// way which is good - defaulting to `rendering`.
|
|
15
|
+
if (process.env.NODE_ENV === 'test') {
|
|
16
|
+
return 'rendering';
|
|
17
|
+
}
|
|
18
|
+
if (typeof window !== 'undefined' && window.remotion_isPlayer) {
|
|
19
|
+
return 'player-development';
|
|
20
|
+
}
|
|
21
|
+
return 'preview';
|
|
22
|
+
};
|
|
23
|
+
exports.getRemotionEnvironment = getRemotionEnvironment;
|
|
24
|
+
const useRemotionEnvironment = () => {
|
|
25
|
+
const isPlayer = (0, is_player_js_1.useIsPlayer)();
|
|
26
|
+
if (isPlayer) {
|
|
27
|
+
if (process.env.NODE_ENV === 'production') {
|
|
28
|
+
return 'player-production';
|
|
29
|
+
}
|
|
30
|
+
return 'player-development';
|
|
31
|
+
}
|
|
32
|
+
return (0, exports.getRemotionEnvironment)();
|
|
33
|
+
};
|
|
34
|
+
exports.useRemotionEnvironment = useRemotionEnvironment;
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "4.0.
|
|
1
|
+
export declare const VERSION = "4.0.39";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/index.mjs
CHANGED
|
@@ -59,7 +59,7 @@ function truthy(value) {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
// Automatically generated on publish
|
|
62
|
-
const VERSION = '4.0.
|
|
62
|
+
const VERSION = '4.0.39';
|
|
63
63
|
|
|
64
64
|
const checkMultipleRemotionVersions = () => {
|
|
65
65
|
if (typeof globalThis === 'undefined') {
|
|
@@ -4634,6 +4634,7 @@ const VideoForRenderingForwardFunction = ({ onError, volume: volumeProp, allowAm
|
|
|
4634
4634
|
current.removeEventListener('loadeddata', loadedDataHandler);
|
|
4635
4635
|
};
|
|
4636
4636
|
}
|
|
4637
|
+
console.log({ currentTime, frame, mediaStartsAt });
|
|
4637
4638
|
current.currentTime = currentTime;
|
|
4638
4639
|
const seekedHandler = () => {
|
|
4639
4640
|
warnAboutNonSeekableMedia(current, 'exception');
|
|
@@ -4683,7 +4684,6 @@ const VideoForRenderingForwardFunction = ({ onError, volume: volumeProp, allowAm
|
|
|
4683
4684
|
videoConfig.fps,
|
|
4684
4685
|
frame,
|
|
4685
4686
|
mediaStartsAt,
|
|
4686
|
-
onError,
|
|
4687
4687
|
]);
|
|
4688
4688
|
const { src } = props;
|
|
4689
4689
|
// If video source switches, make new handle
|
|
@@ -4715,6 +4715,7 @@ const VideoForRenderingForwardFunction = ({ onError, volume: volumeProp, allowAm
|
|
|
4715
4715
|
};
|
|
4716
4716
|
}, [src, onDuration]);
|
|
4717
4717
|
}
|
|
4718
|
+
console.log(JSON.stringify({ props }));
|
|
4718
4719
|
return jsx("video", { ref: videoRef, ...props, onError: onError });
|
|
4719
4720
|
};
|
|
4720
4721
|
const VideoForRendering = forwardRef(VideoForRenderingForwardFunction);
|
|
@@ -4735,6 +4736,14 @@ const VideoForwardingFunction = (props, ref) => {
|
|
|
4735
4736
|
const onDuration = useCallback((src, durationInSeconds) => {
|
|
4736
4737
|
setDurations({ type: 'got-duration', durationInSeconds, src });
|
|
4737
4738
|
}, [setDurations]);
|
|
4739
|
+
useEffect(() => {
|
|
4740
|
+
const interval = setInterval(() => {
|
|
4741
|
+
console.log('event loop still running');
|
|
4742
|
+
}, 2000);
|
|
4743
|
+
return () => {
|
|
4744
|
+
clearInterval(interval);
|
|
4745
|
+
};
|
|
4746
|
+
}, []);
|
|
4738
4747
|
if (loop && props.src && durations[getAbsoluteSrc(props.src)] !== undefined) {
|
|
4739
4748
|
const mediaDuration = durations[getAbsoluteSrc(props.src)] * fps;
|
|
4740
4749
|
return (jsx(Loop, { durationInFrames: calculateLoopDuration({
|
|
@@ -4752,6 +4761,7 @@ const VideoForwardingFunction = (props, ref) => {
|
|
|
4752
4761
|
}
|
|
4753
4762
|
validateMediaProps(props, 'Video');
|
|
4754
4763
|
if (environment.isRendering) {
|
|
4764
|
+
console.log('rendering');
|
|
4755
4765
|
return (jsx(VideoForRendering, { onDuration: onDuration, ...otherProps, ref: ref }));
|
|
4756
4766
|
}
|
|
4757
4767
|
return (jsx(VideoForDevelopment, { onlyWarnForMediaSeekingError: false, ...otherProps, ref: ref, onDuration: onDuration }));
|
package/dist/esm/version.mjs
CHANGED