remotion 4.0.536 → 4.0.538
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/AbsoluteFill.d.ts +62 -62
- package/dist/cjs/AbsoluteFill.js +3 -3
- package/dist/cjs/AbsoluteFillElement.d.ts +1 -1
- package/dist/cjs/AbsoluteFillElement.js +36 -3
- package/dist/cjs/CanUseRemotionHooks.js +1 -1
- package/dist/cjs/Composition.js +5 -11
- package/dist/cjs/CompositionErrorBoundary.js +5 -2
- package/dist/cjs/CompositionManager.d.ts +1 -0
- package/dist/cjs/CompositionManagerContext.d.ts +3 -0
- package/dist/cjs/CompositionManagerContext.js +5 -3
- package/dist/cjs/CompositionManagerProvider.d.ts +1 -1
- package/dist/cjs/CompositionManagerProvider.js +3 -1
- package/dist/cjs/CompositionRegistryProvider.d.ts +1 -1
- package/dist/cjs/CompositionRegistryProvider.js +1 -1
- package/dist/cjs/EditorProps.d.ts +2 -2
- package/dist/cjs/EditorProps.js +1 -1
- package/dist/cjs/Folder.js +1 -1
- package/dist/cjs/HtmlInCanvas.d.ts +58 -67
- package/dist/cjs/HtmlInCanvas.js +84 -20
- package/dist/cjs/HtmlInCanvasFallback.d.ts +6 -0
- package/dist/cjs/HtmlInCanvasFallback.js +39 -0
- package/dist/cjs/IFrame.d.ts +2 -2
- package/dist/cjs/IFrame.js +1 -1
- package/dist/cjs/Img.d.ts +62 -62
- package/dist/cjs/Img.js +160 -132
- package/dist/cjs/Interactive.d.ts +147 -145
- package/dist/cjs/Interactive.js +2 -2
- package/dist/cjs/RemotionRoot.js +1 -1
- package/dist/cjs/RenderAssetManager.js +1 -1
- package/dist/cjs/Sequence.js +37 -27
- package/dist/cjs/SequenceActivityBoundary.js +1 -1
- package/dist/cjs/SequenceActivityBudget.js +1 -1
- package/dist/cjs/SequenceActivitySuspensionProvider.js +1 -1
- package/dist/cjs/SequenceManager.d.ts +6 -0
- package/dist/cjs/SequenceManager.js +71 -27
- package/dist/cjs/SequenceRegistryProvider.js +16 -3
- package/dist/cjs/TimelineContext.js +1 -1
- package/dist/cjs/Track.js +2 -2
- package/dist/cjs/animated-image/AnimatedImage.d.ts +69 -69
- package/dist/cjs/animated-image/AnimatedImage.js +17 -12
- package/dist/cjs/animated-image/canvas.d.ts +6 -5
- package/dist/cjs/animated-image/canvas.js +1 -1
- package/dist/cjs/animated-image/create-image-decoder.d.ts +1 -1
- package/dist/cjs/animated-image/decode-image.d.ts +1 -1
- package/dist/cjs/animated-image/get-duration-in-seconds.d.ts +1 -1
- package/dist/cjs/animated-image/index.js +1 -1
- package/dist/cjs/audio/AudioForPreview.js +5 -28
- package/dist/cjs/audio/AudioForRendering.d.ts +5 -20
- package/dist/cjs/audio/AudioForRendering.js +44 -5
- package/dist/cjs/audio/html5-audio.d.ts +36 -36
- package/dist/cjs/audio/html5-audio.js +8 -10
- package/dist/cjs/audio/index.js +1 -1
- package/dist/cjs/audio/shared-audio-tags.js +10 -16
- package/dist/cjs/audio/shared-element-source-node.d.ts +1 -1
- package/dist/cjs/audio/use-audio-context.d.ts +2 -1
- package/dist/cjs/audio/wait-until-actually-resumed.d.ts +2 -1
- package/dist/cjs/buffer-until-first-frame.d.ts +4 -3
- package/dist/cjs/buffering.js +1 -1
- package/dist/cjs/cancel-render.js +3 -0
- package/dist/cjs/canvas-image/CanvasImage.d.ts +71 -71
- package/dist/cjs/canvas-image/CanvasImage.js +27 -24
- package/dist/cjs/canvas-image/index.js +1 -1
- package/dist/cjs/codec.d.ts +1 -1
- package/dist/cjs/committed-metadata.d.ts +4 -2
- package/dist/cjs/composition-registry-fallback.d.ts +4 -2
- package/dist/cjs/composition-registry-fallback.js +12 -10
- package/dist/cjs/create-element-source-proxy.js +46 -6
- package/dist/cjs/default-css.d.ts +1 -1
- package/dist/cjs/delay-render.d.ts +2 -1
- package/dist/cjs/delay-render.js +4 -2
- package/dist/cjs/easing.js +3 -1
- package/dist/cjs/effects/Solid.d.ts +60 -60
- package/dist/cjs/effects/Solid.js +2 -2
- package/dist/cjs/effects/canvas-pool.js +6 -9
- package/dist/cjs/effects/index.js +1 -1
- package/dist/cjs/effects/use-memoized-effects.d.ts +2 -1
- package/dist/cjs/effects/use-memoized-effects.js +107 -54
- package/dist/cjs/freeze.js +2 -2
- package/dist/cjs/get-cross-origin-value.d.ts +1 -1
- package/dist/cjs/get-effective-visual-mode-value.d.ts +2 -2
- package/dist/cjs/index.d.ts +3 -1
- package/dist/cjs/index.js +32 -32
- package/dist/cjs/interactivity-schema.d.ts +286 -286
- package/dist/cjs/internals.d.ts +411 -595
- package/dist/cjs/internals.js +8 -0
- package/dist/cjs/interpolate-colors.d.ts +1 -1
- package/dist/cjs/interpolate-colors.js +17 -16
- package/dist/cjs/interpolate.d.ts +2 -9
- package/dist/cjs/is-player.js +1 -1
- package/dist/cjs/loading-indicator.js +2 -6
- package/dist/cjs/log-level-context.d.ts +1 -1
- package/dist/cjs/log.d.ts +12 -7
- package/dist/cjs/loop/index.js +1 -1
- package/dist/cjs/media-resource-manager.d.ts +1 -1
- package/dist/cjs/media-tag-current-time-timestamp.d.ts +1 -1
- package/dist/cjs/no-react.d.ts +85 -91
- package/dist/cjs/no-react.js +2 -2
- package/dist/cjs/play-and-handle-not-allowed-error.d.ts +5 -4
- package/dist/cjs/playback-logging.d.ts +2 -1
- package/dist/cjs/playback-pitch-context.d.ts +1 -0
- package/dist/cjs/playback-pitch-context.js +5 -0
- package/dist/cjs/prefetch-state.js +1 -1
- package/dist/cjs/prefetch.d.ts +7 -6
- package/dist/cjs/props-if-has-props.d.ts +2 -1
- package/dist/cjs/prores-profile.d.ts +1 -1
- package/dist/cjs/register-root.d.ts +2 -2
- package/dist/cjs/render-resource-manager.d.ts +1 -1
- package/dist/cjs/render-types.d.ts +2 -2
- package/dist/cjs/resolve-video-config.d.ts +8 -8
- package/dist/cjs/runtime-value-store.d.ts +1 -1
- package/dist/cjs/scale-value.d.ts +1 -1
- package/dist/cjs/seek.d.ts +3 -2
- package/dist/cjs/sequence-activity-context.js +1 -1
- package/dist/cjs/sequence-crop.js +1 -4
- package/dist/cjs/series/flatten-children.d.ts +3 -1
- package/dist/cjs/series/index.js +4 -5
- package/dist/cjs/series/is-inside-series.js +2 -2
- package/dist/cjs/spring/index.d.ts +1 -1
- package/dist/cjs/spring/index.js +1 -1
- package/dist/cjs/spring/measure-spring.d.ts +1 -1
- package/dist/cjs/spring/spring-utils.d.ts +1 -1
- package/dist/cjs/spring/spring-utils.js +11 -5
- package/dist/cjs/timeline-position-state.d.ts +2 -1
- package/dist/cjs/timeline-position-state.js +23 -3
- package/dist/cjs/use-amplification.d.ts +4 -7
- package/dist/cjs/use-current-frame.d.ts +1 -0
- package/dist/cjs/use-current-frame.js +14 -7
- package/dist/cjs/use-current-scale.d.ts +2 -2
- package/dist/cjs/use-delay-render.d.ts +2 -1
- package/dist/cjs/use-lazy-component.d.ts +1 -1
- package/dist/cjs/use-lazy-component.js +15 -5
- package/dist/cjs/use-media-buffering.d.ts +3 -2
- package/dist/cjs/use-media-duration.d.ts +4 -0
- package/dist/cjs/use-media-duration.js +36 -0
- package/dist/cjs/use-media-enabled.d.ts +1 -1
- package/dist/cjs/use-media-enabled.js +1 -1
- package/dist/cjs/use-media-in-timeline.d.ts +1 -1
- package/dist/cjs/use-media-playback.d.ts +3 -3
- package/dist/cjs/use-media-tag.d.ts +2 -2
- package/dist/cjs/use-pixel-density.d.ts +1 -1
- package/dist/cjs/use-premounting.d.ts +1 -1
- package/dist/cjs/use-premounting.js +6 -2
- package/dist/cjs/use-request-video-callback-time.d.ts +3 -3
- package/dist/cjs/use-schema.d.ts +4 -4
- package/dist/cjs/use-video.js +1 -1
- package/dist/cjs/validate-media-props.d.ts +1 -1
- package/dist/cjs/validation/validate-default-props.d.ts +1 -1
- package/dist/cjs/validation/validate-duration-in-frames.js +3 -3
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/video/MediaPlaybackError.js +0 -1
- package/dist/cjs/video/OffthreadVideo.js +5 -5
- package/dist/cjs/video/OffthreadVideoForRendering.js +9 -7
- package/dist/cjs/video/VideoForPreview.js +6 -28
- package/dist/cjs/video/VideoForRendering.d.ts +5 -3
- package/dist/cjs/video/VideoForRendering.js +4 -2
- package/dist/cjs/video/duration-state.d.ts +1 -0
- package/dist/cjs/video/duration-state.js +8 -2
- package/dist/cjs/video/emit-video-frame.d.ts +1 -1
- package/dist/cjs/video/html5-video.d.ts +36 -36
- package/dist/cjs/video/html5-video.js +8 -10
- package/dist/cjs/video/index.js +2 -2
- package/dist/cjs/video/seek-until-right.d.ts +3 -2
- package/dist/cjs/warn-about-non-seekable-media.d.ts +1 -1
- package/dist/cjs/with-interactivity-schema.d.ts +1 -1
- package/dist/cjs/with-interactivity-schema.js +15 -18
- package/dist/cjs/wrap-remotion-context.d.ts +4 -4
- package/dist/cjs/wrap-remotion-context.js +2 -2
- package/dist/esm/index.mjs +1060 -728
- package/dist/esm/no-react.mjs +30 -25
- package/dist/esm/version.mjs +1 -1
- package/package.json +4 -4
|
@@ -1,8 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.AudioForRendering = void 0;
|
|
4
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
38
|
+
const react_1 = __importStar(require("react"));
|
|
6
39
|
const absolute_src_js_1 = require("../absolute-src.js");
|
|
7
40
|
const random_js_1 = require("../random.js");
|
|
8
41
|
const RenderAssetManager_js_1 = require("../RenderAssetManager.js");
|
|
@@ -18,14 +51,13 @@ const use_media_audio_state_js_1 = require("./use-media-audio-state.js");
|
|
|
18
51
|
const AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
19
52
|
var _a, _b;
|
|
20
53
|
const audioRef = (0, react_1.useRef)(null);
|
|
21
|
-
const { volume: volumeProp, playbackRate, allowAmplificationDuringRender, onDuration, toneFrequency, _remotionInternalNeedsDurationCalculation, _remotionInternalNativeLoopPassed, acceptableTimeShiftInSeconds, name, onNativeError, delayRenderRetries, delayRenderTimeoutInMilliseconds, loopVolumeCurveBehavior, pauseWhenBuffering, audioStreamIndex, preservePitch
|
|
54
|
+
const { registerRenderAsset, unregisterRenderAsset, volume: volumeProp, playbackRate, allowAmplificationDuringRender, onDuration, toneFrequency, _remotionInternalNeedsDurationCalculation, _remotionInternalNativeLoopPassed, acceptableTimeShiftInSeconds, name, onNativeError, delayRenderRetries, delayRenderTimeoutInMilliseconds, loopVolumeCurveBehavior, pauseWhenBuffering, audioStreamIndex, preservePitch, ...nativeProps } = props;
|
|
22
55
|
const absoluteFrame = (0, timeline_position_state_js_1.useTimelinePosition)();
|
|
23
56
|
const volumePropFrame = (0, use_audio_frame_js_1.useFrameForVolumeProp)(loopVolumeCurveBehavior !== null && loopVolumeCurveBehavior !== void 0 ? loopVolumeCurveBehavior : 'repeat');
|
|
24
57
|
const frame = (0, use_current_frame_js_1.useCurrentFrame)();
|
|
25
58
|
const sequenceContext = (0, react_1.useContext)(SequenceContext_js_1.SequenceContext);
|
|
26
59
|
const sequencePlaybackRate = (_a = sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.playbackRate) !== null && _a !== void 0 ? _a : 1;
|
|
27
60
|
const audioStartFrame = (0, react_1.useContext)(use_audio_frame_js_1.Html5MediaTrimContext);
|
|
28
|
-
const { registerRenderAsset, unregisterRenderAsset } = (0, react_1.useContext)(RenderAssetManager_js_1.RenderAssetManager);
|
|
29
61
|
const { delayRender, continueRender } = (0, use_delay_render_js_1.useDelayRender)();
|
|
30
62
|
// Generate a string that's as unique as possible for this asset
|
|
31
63
|
// but at the same time the same on all threads
|
|
@@ -73,6 +105,7 @@ const AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
73
105
|
toneFrequency: toneFrequency !== null && toneFrequency !== void 0 ? toneFrequency : 1,
|
|
74
106
|
audioStartFrame,
|
|
75
107
|
audioStreamIndex: audioStreamIndex !== null && audioStreamIndex !== void 0 ? audioStreamIndex : 0,
|
|
108
|
+
preservePitch: preservePitch !== null && preservePitch !== void 0 ? preservePitch : true,
|
|
76
109
|
});
|
|
77
110
|
return () => unregisterRenderAsset(id);
|
|
78
111
|
}, [
|
|
@@ -91,6 +124,7 @@ const AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
91
124
|
audioStartFrame,
|
|
92
125
|
sequencePlaybackRate,
|
|
93
126
|
audioStreamIndex,
|
|
127
|
+
preservePitch,
|
|
94
128
|
]);
|
|
95
129
|
const { src } = props;
|
|
96
130
|
// The <audio> tag is only rendered if the duration needs to be calculated for the `loop`
|
|
@@ -140,6 +174,11 @@ const AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
140
174
|
if (!needsToRenderAudioTag) {
|
|
141
175
|
return null;
|
|
142
176
|
}
|
|
143
|
-
return jsx_runtime_1.jsx("audio", { ref: audioRef, ...nativeProps, onError: onNativeError });
|
|
177
|
+
return (0, jsx_runtime_1.jsx)("audio", { ref: audioRef, ...nativeProps, onError: onNativeError });
|
|
144
178
|
};
|
|
145
|
-
|
|
179
|
+
// Asset collection updates the context, but the audio component only needs its callbacks.
|
|
180
|
+
const MemoAudioForRendering = react_1.default.memo((0, react_1.forwardRef)(AudioForRenderingRefForwardingFunction));
|
|
181
|
+
exports.AudioForRendering = (0, react_1.forwardRef)((props, ref) => {
|
|
182
|
+
const { registerRenderAsset, unregisterRenderAsset } = (0, react_1.useContext)(RenderAssetManager_js_1.RenderAssetManager);
|
|
183
|
+
return ((0, jsx_runtime_1.jsx)(MemoAudioForRendering, { ...props, ref: ref, registerRenderAsset: registerRenderAsset, unregisterRenderAsset: unregisterRenderAsset }));
|
|
184
|
+
});
|
|
@@ -5,54 +5,54 @@ import type { RemotionMainAudioProps } from './props.js';
|
|
|
5
5
|
* @see [Documentation](https://remotion.dev/docs/html5-audio)
|
|
6
6
|
*/
|
|
7
7
|
export declare const Html5Audio: React.ForwardRefExoticComponent<Omit<import("./props.js").NativeAudioProps & {
|
|
8
|
-
name?: string
|
|
9
|
-
volume?: import("../volume-prop.js").VolumeProp
|
|
10
|
-
playbackRate?: number
|
|
11
|
-
preservePitch?: boolean
|
|
12
|
-
acceptableTimeShiftInSeconds?: number
|
|
13
|
-
allowAmplificationDuringRender?: boolean
|
|
14
|
-
_remotionInternalNeedsDurationCalculation?: boolean
|
|
15
|
-
_remotionInternalNativeLoopPassed?: boolean
|
|
16
|
-
toneFrequency?: number
|
|
17
|
-
useWebAudioApi?: boolean
|
|
18
|
-
pauseWhenBuffering?: boolean
|
|
19
|
-
showInTimeline?: boolean
|
|
20
|
-
delayRenderTimeoutInMilliseconds?: number
|
|
21
|
-
delayRenderRetries?: number
|
|
22
|
-
loopVolumeCurveBehavior?: import("./use-audio-frame.js").LoopVolumeCurveBehavior
|
|
23
|
-
onError?: (
|
|
24
|
-
audioStreamIndex?: number
|
|
8
|
+
name?: string;
|
|
9
|
+
volume?: import("../volume-prop.js").VolumeProp;
|
|
10
|
+
playbackRate?: number;
|
|
11
|
+
preservePitch?: boolean;
|
|
12
|
+
acceptableTimeShiftInSeconds?: number;
|
|
13
|
+
allowAmplificationDuringRender?: boolean;
|
|
14
|
+
_remotionInternalNeedsDurationCalculation?: boolean;
|
|
15
|
+
_remotionInternalNativeLoopPassed?: boolean;
|
|
16
|
+
toneFrequency?: number;
|
|
17
|
+
useWebAudioApi?: boolean;
|
|
18
|
+
pauseWhenBuffering?: boolean;
|
|
19
|
+
showInTimeline?: boolean;
|
|
20
|
+
delayRenderTimeoutInMilliseconds?: number;
|
|
21
|
+
delayRenderRetries?: number;
|
|
22
|
+
loopVolumeCurveBehavior?: import("./use-audio-frame.js").LoopVolumeCurveBehavior;
|
|
23
|
+
onError?: (err: Error) => void;
|
|
24
|
+
audioStreamIndex?: number;
|
|
25
25
|
} & RemotionMainAudioProps & {
|
|
26
26
|
/**
|
|
27
27
|
* @deprecated For internal use only
|
|
28
28
|
*/
|
|
29
|
-
readonly _remotionInternalStack?: string
|
|
29
|
+
readonly _remotionInternalStack?: string;
|
|
30
30
|
}, "ref"> & React.RefAttributes<HTMLAudioElement>>;
|
|
31
31
|
/**
|
|
32
32
|
* @deprecated This component has been renamed to `Html5Audio`.
|
|
33
33
|
* @see [Documentation](https://remotion.dev/docs/mediabunny/new-video)
|
|
34
34
|
*/
|
|
35
35
|
export declare const Audio: React.ForwardRefExoticComponent<Omit<import("./props.js").NativeAudioProps & {
|
|
36
|
-
name?: string
|
|
37
|
-
volume?: import("../volume-prop.js").VolumeProp
|
|
38
|
-
playbackRate?: number
|
|
39
|
-
preservePitch?: boolean
|
|
40
|
-
acceptableTimeShiftInSeconds?: number
|
|
41
|
-
allowAmplificationDuringRender?: boolean
|
|
42
|
-
_remotionInternalNeedsDurationCalculation?: boolean
|
|
43
|
-
_remotionInternalNativeLoopPassed?: boolean
|
|
44
|
-
toneFrequency?: number
|
|
45
|
-
useWebAudioApi?: boolean
|
|
46
|
-
pauseWhenBuffering?: boolean
|
|
47
|
-
showInTimeline?: boolean
|
|
48
|
-
delayRenderTimeoutInMilliseconds?: number
|
|
49
|
-
delayRenderRetries?: number
|
|
50
|
-
loopVolumeCurveBehavior?: import("./use-audio-frame.js").LoopVolumeCurveBehavior
|
|
51
|
-
onError?: (
|
|
52
|
-
audioStreamIndex?: number
|
|
36
|
+
name?: string;
|
|
37
|
+
volume?: import("../volume-prop.js").VolumeProp;
|
|
38
|
+
playbackRate?: number;
|
|
39
|
+
preservePitch?: boolean;
|
|
40
|
+
acceptableTimeShiftInSeconds?: number;
|
|
41
|
+
allowAmplificationDuringRender?: boolean;
|
|
42
|
+
_remotionInternalNeedsDurationCalculation?: boolean;
|
|
43
|
+
_remotionInternalNativeLoopPassed?: boolean;
|
|
44
|
+
toneFrequency?: number;
|
|
45
|
+
useWebAudioApi?: boolean;
|
|
46
|
+
pauseWhenBuffering?: boolean;
|
|
47
|
+
showInTimeline?: boolean;
|
|
48
|
+
delayRenderTimeoutInMilliseconds?: number;
|
|
49
|
+
delayRenderRetries?: number;
|
|
50
|
+
loopVolumeCurveBehavior?: import("./use-audio-frame.js").LoopVolumeCurveBehavior;
|
|
51
|
+
onError?: (err: Error) => void;
|
|
52
|
+
audioStreamIndex?: number;
|
|
53
53
|
} & RemotionMainAudioProps & {
|
|
54
54
|
/**
|
|
55
55
|
* @deprecated For internal use only
|
|
56
56
|
*/
|
|
57
|
-
readonly _remotionInternalStack?: string
|
|
57
|
+
readonly _remotionInternalStack?: string;
|
|
58
58
|
}, "ref"> & React.RefAttributes<HTMLAudioElement>>;
|
|
@@ -61,9 +61,7 @@ const AudioRefForwardingFunction = (props, ref) => {
|
|
|
61
61
|
console.warn(errMessage);
|
|
62
62
|
}
|
|
63
63
|
}, [loop, onRemotionError, preloadedSrc]);
|
|
64
|
-
const onDuration = (0, react_1.
|
|
65
|
-
setDurations({ type: 'got-duration', durationInSeconds, src });
|
|
66
|
-
}, [setDurations]);
|
|
64
|
+
const onDuration = (0, react_1.useMemo)(() => duration_state_js_1.onMediaDuration.bind(null, setDurations), [setDurations]);
|
|
67
65
|
const durationFetched = (_a = durations[(0, absolute_src_js_1.getAbsoluteSrc)(preloadedSrc)]) !== null && _a !== void 0 ? _a : durations[(0, absolute_src_js_1.getAbsoluteSrc)(props.src)];
|
|
68
66
|
(0, validate_start_from_props_js_1.validateMediaTrimProps)({ startFrom, endAt, trimBefore, trimAfter });
|
|
69
67
|
if (durationInFrames !== undefined) {
|
|
@@ -88,22 +86,22 @@ const AudioRefForwardingFunction = (props, ref) => {
|
|
|
88
86
|
const loopDuration = effectiveTrimAfter !== null && effectiveTrimAfter !== void 0 ? effectiveTrimAfter : (durationFetched === undefined ? undefined : durationFetched * fps);
|
|
89
87
|
if (loop && loopDuration !== undefined) {
|
|
90
88
|
if (!Number.isFinite(loopDuration)) {
|
|
91
|
-
return (jsx_runtime_1.jsx(exports.Html5Audio, { ...propsOtherThanLoop, ref: ref, _remotionInternalNativeLoopPassed: true }));
|
|
89
|
+
return ((0, jsx_runtime_1.jsx)(exports.Html5Audio, { ...propsOtherThanLoop, ref: ref, _remotionInternalNativeLoopPassed: true }));
|
|
92
90
|
}
|
|
93
|
-
return (jsx_runtime_1.jsx(index_js_1.Loop, { layout: "none", durationInFrames: (0, calculate_media_duration_js_1.calculateMediaDuration)({
|
|
91
|
+
return ((0, jsx_runtime_1.jsx)(index_js_1.Loop, { layout: "none", durationInFrames: (0, calculate_media_duration_js_1.calculateMediaDuration)({
|
|
94
92
|
trimAfter: effectiveTrimAfter,
|
|
95
93
|
mediaDurationInFrames: loopDuration,
|
|
96
94
|
playbackRate: (_b = props.playbackRate) !== null && _b !== void 0 ? _b : 1,
|
|
97
95
|
trimBefore: trimBeforeValue,
|
|
98
|
-
}), children: jsx_runtime_1.jsx(exports.Html5Audio, { ...propsOtherThanLoop, ref: ref, _remotionInternalNativeLoopPassed: true }) }));
|
|
96
|
+
}), children: (0, jsx_runtime_1.jsx)(exports.Html5Audio, { ...propsOtherThanLoop, ref: ref, _remotionInternalNativeLoopPassed: true }) }));
|
|
99
97
|
}
|
|
100
98
|
if (typeof trimBeforeValue !== 'undefined' ||
|
|
101
99
|
typeof effectiveTrimAfter !== 'undefined') {
|
|
102
|
-
return (jsx_runtime_1.jsx(use_audio_frame_js_1.Html5MediaTrimContext.Provider, { value: trimBeforeValue !== null && trimBeforeValue !== void 0 ? trimBeforeValue : 0, children: jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", from: 0 - (trimBeforeValue !== null && trimBeforeValue !== void 0 ? trimBeforeValue : 0), showInTimeline: false, durationInFrames: effectiveTrimAfter === undefined
|
|
100
|
+
return ((0, jsx_runtime_1.jsx)(use_audio_frame_js_1.Html5MediaTrimContext.Provider, { value: trimBeforeValue !== null && trimBeforeValue !== void 0 ? trimBeforeValue : 0, children: (0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { layout: "none", from: 0 - (trimBeforeValue !== null && trimBeforeValue !== void 0 ? trimBeforeValue : 0), showInTimeline: false, durationInFrames: effectiveTrimAfter === undefined
|
|
103
101
|
? undefined
|
|
104
102
|
: (trimBeforeValue !== null && trimBeforeValue !== void 0 ? trimBeforeValue : 0) +
|
|
105
103
|
(effectiveTrimAfter - (trimBeforeValue !== null && trimBeforeValue !== void 0 ? trimBeforeValue : 0)) /
|
|
106
|
-
((_c = props.playbackRate) !== null && _c !== void 0 ? _c : 1), name: name, children: jsx_runtime_1.jsx(exports.Html5Audio, { _remotionInternalNeedsDurationCalculation: Boolean(loop), pauseWhenBuffering: shouldPauseWhenBuffering, ...otherProps, ref: ref }) }) }));
|
|
104
|
+
((_c = props.playbackRate) !== null && _c !== void 0 ? _c : 1), name: name, children: (0, jsx_runtime_1.jsx)(exports.Html5Audio, { _remotionInternalNeedsDurationCalculation: Boolean(loop), pauseWhenBuffering: shouldPauseWhenBuffering, ...otherProps, ref: ref }) }) }));
|
|
107
105
|
}
|
|
108
106
|
(0, validate_media_props_js_1.validateMediaProps)({
|
|
109
107
|
playbackRate: props.playbackRate,
|
|
@@ -111,9 +109,9 @@ const AudioRefForwardingFunction = (props, ref) => {
|
|
|
111
109
|
volume: props.volume,
|
|
112
110
|
}, 'Html5Audio');
|
|
113
111
|
if (environment.isRendering) {
|
|
114
|
-
return (jsx_runtime_1.jsx(AudioForRendering_js_1.AudioForRendering, { onDuration: onDuration, ...props, ref: ref, onNativeError: onError, _remotionInternalNeedsDurationCalculation: Boolean(loop) }));
|
|
112
|
+
return ((0, jsx_runtime_1.jsx)(AudioForRendering_js_1.AudioForRendering, { onDuration: onDuration, ...props, ref: ref, onNativeError: onError, _remotionInternalNeedsDurationCalculation: Boolean(loop) }));
|
|
115
113
|
}
|
|
116
|
-
return (jsx_runtime_1.jsx(AudioForPreview_js_1.AudioForPreview, { _remotionInternalNativeLoopPassed: (_d = props._remotionInternalNativeLoopPassed) !== null && _d !== void 0 ? _d : false, _remotionInternalStack: _remotionInternalStack !== null && _remotionInternalStack !== void 0 ? _remotionInternalStack : null, shouldPreMountAudioTags: audioTagsContext !== null && audioTagsContext.numberOfAudioTags > 0, ...props, ref: ref, onNativeError: onError, onDuration: onDuration, pauseWhenBuffering: shouldPauseWhenBuffering, _remotionInternalNeedsDurationCalculation: Boolean(loop), showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true }));
|
|
114
|
+
return ((0, jsx_runtime_1.jsx)(AudioForPreview_js_1.AudioForPreview, { _remotionInternalNativeLoopPassed: (_d = props._remotionInternalNativeLoopPassed) !== null && _d !== void 0 ? _d : false, _remotionInternalStack: _remotionInternalStack !== null && _remotionInternalStack !== void 0 ? _remotionInternalStack : null, shouldPreMountAudioTags: audioTagsContext !== null && audioTagsContext.numberOfAudioTags > 0, ...props, ref: ref, onNativeError: onError, onDuration: onDuration, pauseWhenBuffering: shouldPauseWhenBuffering, _remotionInternalNeedsDurationCalculation: Boolean(loop), showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true }));
|
|
117
115
|
};
|
|
118
116
|
/**
|
|
119
117
|
* @description With this component, you can add audio to your video. All audio formats which are supported by Chromium are supported by the component.
|
package/dist/cjs/audio/index.js
CHANGED
|
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.Html5Audio = exports.Audio = void 0;
|
|
18
|
-
|
|
18
|
+
var html5_audio_js_1 = require("./html5-audio.js");
|
|
19
19
|
Object.defineProperty(exports, "Audio", { enumerable: true, get: function () { return html5_audio_js_1.Audio; } });
|
|
20
20
|
Object.defineProperty(exports, "Html5Audio", { enumerable: true, get: function () { return html5_audio_js_1.Html5Audio; } });
|
|
21
21
|
__exportStar(require("./props.js"), exports);
|
|
@@ -319,10 +319,7 @@ const SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled,
|
|
|
319
319
|
return {
|
|
320
320
|
sampleRate,
|
|
321
321
|
audioContext: (_a = ctxAndGain === null || ctxAndGain === void 0 ? void 0 : ctxAndGain.audioContext) !== null && _a !== void 0 ? _a : null,
|
|
322
|
-
getAudioContextState: () => {
|
|
323
|
-
var _a;
|
|
324
|
-
return (_a = ctxAndGain === null || ctxAndGain === void 0 ? void 0 : ctxAndGain.getState()) !== null && _a !== void 0 ? _a : null;
|
|
325
|
-
},
|
|
322
|
+
getAudioContextState: () => { var _a; return (_a = ctxAndGain === null || ctxAndGain === void 0 ? void 0 : ctxAndGain.getState()) !== null && _a !== void 0 ? _a : null; },
|
|
326
323
|
gainNode: (_b = ctxAndGain === null || ctxAndGain === void 0 ? void 0 : ctxAndGain.gainNode) !== null && _b !== void 0 ? _b : null,
|
|
327
324
|
audioSyncAnchor,
|
|
328
325
|
audioSyncAnchorEmitter,
|
|
@@ -347,7 +344,7 @@ const SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled,
|
|
|
347
344
|
unscheduleAudioNode,
|
|
348
345
|
_experimentalKeepAudioContextAlive,
|
|
349
346
|
]);
|
|
350
|
-
return (jsx_runtime_1.jsx(exports.SharedAudioContext.Provider, { value: audioContextValue, children: children }));
|
|
347
|
+
return ((0, jsx_runtime_1.jsx)(exports.SharedAudioContext.Provider, { value: audioContextValue, children: children }));
|
|
351
348
|
};
|
|
352
349
|
exports.SharedAudioContextProvider = SharedAudioContextProvider;
|
|
353
350
|
const SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
@@ -543,16 +540,17 @@ const SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
543
540
|
]);
|
|
544
541
|
const sharedAudioTagElements = (0, react_1.useMemo)(() => {
|
|
545
542
|
return refs.map(({ id, ref }) => {
|
|
546
|
-
return (
|
|
547
|
-
// Without preload="metadata", iOS will seek the time internally
|
|
548
|
-
// but not actually with sound. Adding `preload="metadata"` helps here.
|
|
549
|
-
// https://discord.com/channels/809501355504959528/817306414069710848/1130519583367888906
|
|
550
|
-
jsx_runtime_1.jsx("audio", { ref: ref, preload: "metadata", src: EMPTY_AUDIO }, id));
|
|
543
|
+
return ((0, jsx_runtime_1.jsx)("audio", { ref: ref, preload: "metadata", src: EMPTY_AUDIO }, id));
|
|
551
544
|
});
|
|
552
545
|
}, [refs]);
|
|
553
|
-
return (jsx_runtime_1.jsxs(exports.SharedAudioTagsContext.Provider, { value: audioTagsValue, children: [sharedAudioTagElements, children] }));
|
|
546
|
+
return ((0, jsx_runtime_1.jsxs)(exports.SharedAudioTagsContext.Provider, { value: audioTagsValue, children: [sharedAudioTagElements, children] }));
|
|
554
547
|
};
|
|
555
548
|
exports.SharedAudioTagsContextProvider = SharedAudioTagsContextProvider;
|
|
549
|
+
const unregisterSharedAudio = (tagsContext, id) => {
|
|
550
|
+
if (tagsContext && tagsContext.numberOfAudioTags > 0) {
|
|
551
|
+
tagsContext.unregisterAudio(id);
|
|
552
|
+
}
|
|
553
|
+
};
|
|
556
554
|
const useSharedAudio = ({ aud, audioId, premounting, postmounting, }) => {
|
|
557
555
|
var _a;
|
|
558
556
|
var _b, _c;
|
|
@@ -608,11 +606,7 @@ const useSharedAudio = ({ aud, audioId, premounting, postmounting, }) => {
|
|
|
608
606
|
}
|
|
609
607
|
}, [aud, tagsCtx, elem.id, audioId, premounting, postmounting]);
|
|
610
608
|
effectToUse(() => {
|
|
611
|
-
return (
|
|
612
|
-
if (tagsCtx && tagsCtx.numberOfAudioTags > 0) {
|
|
613
|
-
tagsCtx.unregisterAudio(elem.id);
|
|
614
|
-
}
|
|
615
|
-
};
|
|
609
|
+
return unregisterSharedAudio.bind(null, tagsCtx, elem.id);
|
|
616
610
|
}, [tagsCtx, elem.id]);
|
|
617
611
|
}
|
|
618
612
|
return elem;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const makeSharedElementSourceNode: ({ audioContext, ref, }: {
|
|
2
2
|
audioContext: AudioContext | null;
|
|
3
|
-
ref:
|
|
3
|
+
ref: React.RefObject<HTMLAudioElement | null>;
|
|
4
4
|
}) => {
|
|
5
5
|
setAudioContext: (newAudioContext: AudioContext | null) => void;
|
|
6
6
|
attemptToConnect: () => void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { LogLevel } from '../log';
|
|
1
2
|
export type RemotionAudioContextState = AudioContextState | 'running-to-suspended' | 'suspended-to-running';
|
|
2
3
|
export declare const useSingletonAudioContext: ({ logLevel, latencyHint, audioEnabled, sampleRate, }: {
|
|
3
|
-
logLevel:
|
|
4
|
+
logLevel: LogLevel;
|
|
4
5
|
latencyHint: AudioContextLatencyCategory;
|
|
5
6
|
audioEnabled: boolean;
|
|
6
7
|
sampleRate: number;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import { type LogLevel } from '../log.js';
|
|
1
2
|
export type AudioContextResumeResult = 'resumed' | 'cancelled' | 'failed';
|
|
2
|
-
export declare const waitUntilActuallyResumed: (audioContext: AudioContext, logLevel:
|
|
3
|
+
export declare const waitUntilActuallyResumed: (audioContext: AudioContext, logLevel: LogLevel, signal: AbortSignal, isAutoPlayAttempt: boolean) => Promise<AudioContextResumeResult>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import type { LogLevel } from './log';
|
|
1
2
|
export declare const useBufferUntilFirstFrame: ({ mediaRef, mediaType, onVariableFpsVideoDetected, pauseWhenBuffering, logLevel, mountTime, }: {
|
|
2
|
-
mediaRef:
|
|
3
|
-
mediaType:
|
|
3
|
+
mediaRef: React.RefObject<HTMLVideoElement | HTMLAudioElement | null>;
|
|
4
|
+
mediaType: 'video' | 'audio';
|
|
4
5
|
onVariableFpsVideoDetected: () => void;
|
|
5
6
|
pauseWhenBuffering: boolean;
|
|
6
|
-
logLevel:
|
|
7
|
+
logLevel: LogLevel;
|
|
7
8
|
mountTime: number | null;
|
|
8
9
|
}) => {
|
|
9
10
|
isBuffering: () => boolean;
|
package/dist/cjs/buffering.js
CHANGED
|
@@ -108,6 +108,6 @@ const BufferingProvider = ({ children }) => {
|
|
|
108
108
|
const { logLevel, mountTime } = (0, react_1.useContext)(log_level_context_1.LogLevelContext);
|
|
109
109
|
const { isBuffering, setBuffering } = (0, react_1.useContext)(TimelineContext_js_1.SetTimelineContext);
|
|
110
110
|
const bufferManager = useBufferManager(logLevel !== null && logLevel !== void 0 ? logLevel : 'info', mountTime, setBuffering, isBuffering);
|
|
111
|
-
return (jsx_runtime_1.jsx(exports.BufferingContextReact.Provider, { value: bufferManager, children: children }));
|
|
111
|
+
return ((0, jsx_runtime_1.jsx)(exports.BufferingContextReact.Provider, { value: bufferManager, children: children }));
|
|
112
112
|
};
|
|
113
113
|
exports.BufferingProvider = BufferingProvider;
|
|
@@ -58,6 +58,9 @@ function cancelRenderInternal(scope, err) {
|
|
|
58
58
|
error = Error('Rendering was cancelled');
|
|
59
59
|
}
|
|
60
60
|
if (scope) {
|
|
61
|
+
// Server rendering reads the stack across Puppeteer. Browser rendering can
|
|
62
|
+
// keep the original Error in this realm, including its cause chain.
|
|
63
|
+
scope.remotion_cancelledErrorObject = error;
|
|
61
64
|
scope.remotion_cancelledError = (0, exports.getErrorStackWithMessage)(error);
|
|
62
65
|
}
|
|
63
66
|
throw error;
|