remotion 4.0.524 → 4.0.526
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 +0 -1
- package/dist/cjs/Img.d.ts +2 -0
- package/dist/cjs/Img.js +23 -18
- package/dist/cjs/Interactive.d.ts +0 -1
- package/dist/cjs/TimelineContext.d.ts +1 -0
- package/dist/cjs/TimelineContext.js +1 -0
- package/dist/cjs/absolute-src.js +1 -1
- package/dist/cjs/animated-image/resolve-image-source.js +1 -1
- package/dist/cjs/audio/AudioForPreview.js +9 -6
- package/dist/cjs/audio/AudioForRendering.js +11 -8
- package/dist/cjs/audio/shared-audio-tags.js +2 -2
- package/dist/cjs/audio/use-media-audio-state.d.ts +17 -0
- package/dist/cjs/audio/use-media-audio-state.js +27 -0
- package/dist/cjs/canvas-image/CanvasImage.d.ts +1 -0
- package/dist/cjs/canvas-image/CanvasImage.js +11 -6
- package/dist/cjs/canvas-image/props.d.ts +1 -0
- package/dist/cjs/delay-render.js +1 -1
- package/dist/cjs/font-face-registry.d.ts +19 -0
- package/dist/cjs/font-face-registry.js +48 -0
- package/dist/cjs/freeze.js +1 -0
- package/dist/cjs/interactivity-schema.d.ts +1 -2
- package/dist/cjs/interactivity-schema.js +0 -1
- package/dist/cjs/internals.d.ts +6 -1
- package/dist/cjs/internals.js +3 -0
- package/dist/cjs/no-react.d.ts +3 -0
- package/dist/cjs/no-react.js +4 -0
- package/dist/cjs/timeline-position-state.d.ts +1 -0
- package/dist/cjs/timeline-position-state.js +5 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/video/OffthreadVideoForRendering.js +13 -11
- package/dist/cjs/video/VideoForPreview.js +8 -3
- package/dist/cjs/video/VideoForRendering.js +14 -11
- package/dist/esm/index.mjs +240 -175
- package/dist/esm/no-react.mjs +35 -2
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
- package/dist/cjs/audio/streaming-pitch-shifter.d.ts +0 -18
- package/dist/cjs/audio/streaming-pitch-shifter.js +0 -349
- package/dist/cjs/interpolate-translate.d.ts +0 -8
- package/dist/cjs/interpolate-translate.js +0 -70
- package/dist/cjs/sequence-field-schema.d.ts +0 -425
- package/dist/cjs/sequence-field-schema.js +0 -133
- package/dist/cjs/wrap-in-schema.d.ts +0 -20
- package/dist/cjs/wrap-in-schema.js +0 -203
package/dist/cjs/Img.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export type ImgProps = NativeImgProps & {
|
|
|
8
8
|
readonly delayRenderRetries?: number;
|
|
9
9
|
readonly delayRenderTimeoutInMilliseconds?: number;
|
|
10
10
|
readonly onImageFrame?: (imageElement: HTMLImageElement) => void;
|
|
11
|
+
readonly onImageError?: (error: Error) => void;
|
|
11
12
|
readonly src: string;
|
|
12
13
|
readonly effects?: EffectsProp;
|
|
13
14
|
readonly showInTimeline?: boolean;
|
|
@@ -225,6 +226,7 @@ export declare const Img: React.ComponentType<NativeImgProps & {
|
|
|
225
226
|
readonly delayRenderRetries?: number | undefined;
|
|
226
227
|
readonly delayRenderTimeoutInMilliseconds?: number | undefined;
|
|
227
228
|
readonly onImageFrame?: ((imageElement: HTMLImageElement) => void) | undefined;
|
|
229
|
+
readonly onImageError?: ((error: Error) => void) | undefined;
|
|
228
230
|
readonly src: string;
|
|
229
231
|
readonly effects?: EffectsProp | undefined;
|
|
230
232
|
readonly showInTimeline?: boolean | undefined;
|
package/dist/cjs/Img.js
CHANGED
|
@@ -22,7 +22,7 @@ const with_interactivity_schema_js_1 = require("./with-interactivity-schema.js")
|
|
|
22
22
|
function exponentialBackoff(errorCount) {
|
|
23
23
|
return 1000 * 2 ** (errorCount - 1);
|
|
24
24
|
}
|
|
25
|
-
const ImgContent = ({ onError, maxRetries = 2, src, pauseWhenLoading, delayRenderRetries, delayRenderTimeoutInMilliseconds, onImageFrame, crossOrigin, decoding, ref, refForOutline, ...props }) => {
|
|
25
|
+
const ImgContent = ({ onError, onImageError, maxRetries = 2, src, pauseWhenLoading, delayRenderRetries, delayRenderTimeoutInMilliseconds, onImageFrame, crossOrigin, decoding, ref, refForOutline, ...props }) => {
|
|
26
26
|
const imageRef = (0, react_1.useRef)(null);
|
|
27
27
|
const errors = (0, react_1.useRef)({});
|
|
28
28
|
const { delayPlayback } = (0, use_buffer_state_js_1.useBufferState)();
|
|
@@ -67,34 +67,36 @@ const ImgContent = ({ onError, maxRetries = 2, src, pauseWhenLoading, delayRende
|
|
|
67
67
|
const isPremounting = Boolean(sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.premounting);
|
|
68
68
|
const isPostmounting = Boolean(sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.postmounting);
|
|
69
69
|
const didGetError = (0, react_1.useCallback)((e) => {
|
|
70
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
71
|
-
var
|
|
70
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
71
|
+
var _j, _k, _l, _m;
|
|
72
72
|
if (!errors.current) {
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
75
|
errors.current[(_a = imageRef.current) === null || _a === void 0 ? void 0 : _a.src] =
|
|
76
|
-
((
|
|
77
|
-
if (onError &&
|
|
78
|
-
((
|
|
79
|
-
onError(e);
|
|
76
|
+
((_j = errors.current[(_b = imageRef.current) === null || _b === void 0 ? void 0 : _b.src]) !== null && _j !== void 0 ? _j : 0) + 1;
|
|
77
|
+
if ((onError || onImageError) &&
|
|
78
|
+
((_k = errors.current[(_c = imageRef.current) === null || _c === void 0 ? void 0 : _c.src]) !== null && _k !== void 0 ? _k : 0) > maxRetries) {
|
|
79
|
+
onError === null || onError === void 0 ? void 0 : onError(e);
|
|
80
|
+
onImageError === null || onImageError === void 0 ? void 0 : onImageError(new Error('Error loading image with src: ' +
|
|
81
|
+
(0, truncate_src_for_label_js_1.truncateSrcForLabel)((_d = imageRef.current) === null || _d === void 0 ? void 0 : _d.src)));
|
|
80
82
|
return;
|
|
81
83
|
}
|
|
82
|
-
if (((
|
|
83
|
-
const backoff = exponentialBackoff((
|
|
84
|
+
if (((_l = errors.current[(_e = imageRef.current) === null || _e === void 0 ? void 0 : _e.src]) !== null && _l !== void 0 ? _l : 0) <= maxRetries) {
|
|
85
|
+
const backoff = exponentialBackoff((_m = errors.current[(_f = imageRef.current) === null || _f === void 0 ? void 0 : _f.src]) !== null && _m !== void 0 ? _m : 0);
|
|
84
86
|
// eslint-disable-next-line no-console
|
|
85
|
-
console.warn(`Could not load image with source ${(0, truncate_src_for_label_js_1.truncateSrcForLabel)((
|
|
87
|
+
console.warn(`Could not load image with source ${(0, truncate_src_for_label_js_1.truncateSrcForLabel)((_g = imageRef.current) === null || _g === void 0 ? void 0 : _g.src)}, retrying again in ${backoff}ms`);
|
|
86
88
|
retryIn(backoff);
|
|
87
89
|
return;
|
|
88
90
|
}
|
|
89
91
|
try {
|
|
90
92
|
cancelRender('Error loading image with src: ' +
|
|
91
|
-
(0, truncate_src_for_label_js_1.truncateSrcForLabel)((
|
|
93
|
+
(0, truncate_src_for_label_js_1.truncateSrcForLabel)((_h = imageRef.current) === null || _h === void 0 ? void 0 : _h.src));
|
|
92
94
|
}
|
|
93
|
-
catch (
|
|
95
|
+
catch (_o) {
|
|
94
96
|
// cancelRender() intentionally throws after storing the error in scope.
|
|
95
97
|
// In async image callbacks, we rely on the stored error for renderer propagation.
|
|
96
98
|
}
|
|
97
|
-
}, [cancelRender, maxRetries, onError, retryIn]);
|
|
99
|
+
}, [cancelRender, maxRetries, onError, onImageError, retryIn]);
|
|
98
100
|
if (typeof window !== 'undefined') {
|
|
99
101
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
100
102
|
(0, react_1.useLayoutEffect)(() => {
|
|
@@ -200,6 +202,10 @@ const NativeImgInner = ({ hidden, name, showInTimeline, src, from, trimBefore, d
|
|
|
200
202
|
if (!src) {
|
|
201
203
|
throw new Error('No "src" prop was passed to <Img>.');
|
|
202
204
|
}
|
|
205
|
+
const isMedia = (0, react_1.useMemo)(() => ({
|
|
206
|
+
type: 'image',
|
|
207
|
+
src,
|
|
208
|
+
}), [src]);
|
|
203
209
|
const { effectivePostmountFor, effectivePremountFor, freezeFrame, isPremountingOrPostmounting, postmountingActive, premountingActive, premountingStyle, } = (0, use_premounting_js_1.usePremounting)({
|
|
204
210
|
from: from !== null && from !== void 0 ? from : 0,
|
|
205
211
|
durationInFrames: durationInFrames !== null && durationInFrames !== void 0 ? durationInFrames : Infinity,
|
|
@@ -218,7 +224,7 @@ const NativeImgInner = ({ hidden, name, showInTimeline, src, from, trimBefore, d
|
|
|
218
224
|
style: premountingStyle,
|
|
219
225
|
componentName: '<Img />',
|
|
220
226
|
});
|
|
221
|
-
return (jsx_runtime_1.jsx(freeze_js_1.Freeze, { frame: freezeFrame, active: isPremountingOrPostmounting, children: jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", from: from !== null && from !== void 0 ? from : 0, trimBefore: trimBefore, durationInFrames: durationInFrames !== null && durationInFrames !== void 0 ? durationInFrames : Infinity, freeze: freeze, _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/img", _remotionInternalIsMedia:
|
|
227
|
+
return (jsx_runtime_1.jsx(freeze_js_1.Freeze, { frame: freezeFrame, active: isPremountingOrPostmounting, children: jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", from: from !== null && from !== void 0 ? from : 0, trimBefore: trimBefore, durationInFrames: durationInFrames !== null && durationInFrames !== void 0 ? durationInFrames : Infinity, freeze: freeze, _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/img", _remotionInternalIsMedia: isMedia, _remotionInternalPremountDisplay: effectivePremountFor || null, _remotionInternalPostmountDisplay: effectivePostmountFor || null, _remotionInternalIsPremounting: premountingActive, _remotionInternalIsPostmounting: postmountingActive, name: name !== null && name !== void 0 ? name : '<Img>', controls: controls, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, hidden: hidden, outlineRef: refForOutline, children: jsx_runtime_1.jsx(ImgContent, { src: src, refForOutline: refForOutline, style: croppedStyle !== null && croppedStyle !== void 0 ? croppedStyle : undefined, ...props }) }) }));
|
|
222
228
|
};
|
|
223
229
|
const CanvasImageWithPrivateProps = index_js_1.CanvasImage;
|
|
224
230
|
exports.imgSchema = {
|
|
@@ -239,7 +245,6 @@ exports.imgSchema = {
|
|
|
239
245
|
};
|
|
240
246
|
const imgCanvasFallbackIncompatibleProps = new Set([
|
|
241
247
|
'alt',
|
|
242
|
-
'crossOrigin',
|
|
243
248
|
'decoding',
|
|
244
249
|
'fetchPriority',
|
|
245
250
|
'loading',
|
|
@@ -276,12 +281,12 @@ const getFitFromObjectFit = (style) => {
|
|
|
276
281
|
}
|
|
277
282
|
return undefined;
|
|
278
283
|
};
|
|
279
|
-
const ImgInner = ({ effects = [], ref, hidden, name, showInTimeline, src, from, trimBefore, durationInFrames, freeze, premountFor, postmountFor, styleWhilePremounted, styleWhilePostmounted, controls, width, height, className, style, cropLeft, cropRight, cropTop, cropBottom, id, pauseWhenLoading, maxRetries, delayRenderRetries, delayRenderTimeoutInMilliseconds, ...props }) => {
|
|
284
|
+
const ImgInner = ({ effects = [], ref, hidden, name, showInTimeline, src, from, trimBefore, durationInFrames, freeze, premountFor, postmountFor, styleWhilePremounted, styleWhilePostmounted, controls, width, height, className, style, cropLeft, cropRight, cropTop, cropBottom, id, pauseWhenLoading, maxRetries, delayRenderRetries, delayRenderTimeoutInMilliseconds, onImageError, ...props }) => {
|
|
280
285
|
var _a;
|
|
281
286
|
const refForOutline = (0, react_1.useRef)(null);
|
|
282
287
|
const shouldPauseWhenLoading = (0, v5_flag_js_1.resolveV5Default)(pauseWhenLoading);
|
|
283
288
|
if (effects.length === 0) {
|
|
284
|
-
return (jsx_runtime_1.jsx(NativeImgInner, { ...props, ref: ref, hidden: hidden, name: name, showInTimeline: showInTimeline, src: src, from: from, trimBefore: trimBefore, durationInFrames: durationInFrames, freeze: freeze, premountFor: premountFor, postmountFor: postmountFor, styleWhilePremounted: styleWhilePremounted, styleWhilePostmounted: styleWhilePostmounted, controls: controls, width: width, height: height, className: className, style: style, cropLeft: cropLeft, cropRight: cropRight, cropTop: cropTop, cropBottom: cropBottom, id: id, pauseWhenLoading: shouldPauseWhenLoading, maxRetries: maxRetries, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds, outlineRef: refForOutline }));
|
|
289
|
+
return (jsx_runtime_1.jsx(NativeImgInner, { ...props, ref: ref, hidden: hidden, name: name, showInTimeline: showInTimeline, src: src, from: from, trimBefore: trimBefore, durationInFrames: durationInFrames, freeze: freeze, premountFor: premountFor, postmountFor: postmountFor, styleWhilePremounted: styleWhilePremounted, styleWhilePostmounted: styleWhilePostmounted, controls: controls, width: width, height: height, className: className, style: style, cropLeft: cropLeft, cropRight: cropRight, cropTop: cropTop, cropBottom: cropBottom, id: id, pauseWhenLoading: shouldPauseWhenLoading, maxRetries: maxRetries, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds, onImageError: onImageError, outlineRef: refForOutline }));
|
|
285
290
|
}
|
|
286
291
|
if (!src) {
|
|
287
292
|
throw new Error('No "src" prop was passed to <Img>.');
|
|
@@ -296,7 +301,7 @@ const ImgInner = ({ effects = [], ref, hidden, name, showInTimeline, src, from,
|
|
|
296
301
|
const canvasHeight = typeof height === 'number' ? height : undefined;
|
|
297
302
|
const canvasProps = props;
|
|
298
303
|
const canvasFit = (_a = getFitFromObjectFit(style)) !== null && _a !== void 0 ? _a : 'fill';
|
|
299
|
-
return (jsx_runtime_1.jsx(CanvasImageWithPrivateProps, { src: src, width: canvasWidth, height: canvasHeight, fit: canvasFit, effects: effects, className: className, style: style, cropLeft: cropLeft, cropRight: cropRight, cropTop: cropTop, cropBottom: cropBottom, id: id, pauseWhenLoading: shouldPauseWhenLoading, maxRetries: maxRetries, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds, from: from, trimBefore: trimBefore, durationInFrames: durationInFrames, freeze: freeze, premountFor: premountFor, postmountFor: postmountFor, styleWhilePremounted: styleWhilePremounted, styleWhilePostmounted: styleWhilePostmounted, hidden: hidden, name: name !== null && name !== void 0 ? name : '<Img>', showInTimeline: showInTimeline, _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/img", _remotionInternalCropComponentName: "<Img />", controls: controls, outlineRef: refForOutline, ...canvasProps }));
|
|
304
|
+
return (jsx_runtime_1.jsx(CanvasImageWithPrivateProps, { src: src, width: canvasWidth, height: canvasHeight, fit: canvasFit, effects: effects, className: className, style: style, cropLeft: cropLeft, cropRight: cropRight, cropTop: cropTop, cropBottom: cropBottom, id: id, onError: onImageError, pauseWhenLoading: shouldPauseWhenLoading, maxRetries: maxRetries, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds, from: from, trimBefore: trimBefore, durationInFrames: durationInFrames, freeze: freeze, premountFor: premountFor, postmountFor: postmountFor, styleWhilePremounted: styleWhilePremounted, styleWhilePostmounted: styleWhilePostmounted, hidden: hidden, name: name !== null && name !== void 0 ? name : '<Img>', showInTimeline: showInTimeline, _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/img", _remotionInternalCropComponentName: "<Img />", controls: controls, outlineRef: refForOutline, ...canvasProps }));
|
|
300
305
|
};
|
|
301
306
|
/*
|
|
302
307
|
* @description Works just like a regular HTML img tag. When you use the <Img> tag, Remotion will ensure that the image is loaded before rendering the frame.
|
|
@@ -4,6 +4,7 @@ import { type PlayableMediaTag } from './timeline-position-state';
|
|
|
4
4
|
export type TimelineContextValue = {
|
|
5
5
|
frame: Record<string, number>;
|
|
6
6
|
isPlaying: () => boolean;
|
|
7
|
+
isInsideFreeze: boolean;
|
|
7
8
|
audioAndVideoTags: RefObject<PlayableMediaTag[]>;
|
|
8
9
|
};
|
|
9
10
|
export type PlaybackRateContextValue = {
|
package/dist/cjs/absolute-src.js
CHANGED
|
@@ -13,6 +13,6 @@ const getAbsoluteSrc = (relativeSrc) => {
|
|
|
13
13
|
relativeSrc.startsWith('data:')) {
|
|
14
14
|
return relativeSrc;
|
|
15
15
|
}
|
|
16
|
-
return new URL(relativeSrc,
|
|
16
|
+
return new URL(relativeSrc, document.baseURI).href;
|
|
17
17
|
};
|
|
18
18
|
exports.getAbsoluteSrc = getAbsoluteSrc;
|
|
@@ -53,6 +53,7 @@ const volume_prop_js_1 = require("../volume-prop.js");
|
|
|
53
53
|
const volume_safeguard_js_1 = require("../volume-safeguard.js");
|
|
54
54
|
const shared_audio_tags_js_1 = require("./shared-audio-tags.js");
|
|
55
55
|
const use_audio_frame_js_1 = require("./use-audio-frame.js");
|
|
56
|
+
const use_media_audio_state_js_1 = require("./use-media-audio-state.js");
|
|
56
57
|
const AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
57
58
|
var _a, _b, _c;
|
|
58
59
|
const [initialShouldPreMountAudioElements] = (0, react_2.useState)(props.shouldPreMountAudioTags);
|
|
@@ -68,7 +69,6 @@ const AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
68
69
|
throw new Error('typecheck error');
|
|
69
70
|
}
|
|
70
71
|
const [mediaVolume] = (0, volume_position_state_js_1.useMediaVolumeState)();
|
|
71
|
-
const [playerMuted] = (0, volume_position_state_js_1.usePlayerMutedState)();
|
|
72
72
|
const volumePropFrame = (0, use_audio_frame_js_1.useFrameForVolumeProp)(loopVolumeCurveBehavior !== null && loopVolumeCurveBehavior !== void 0 ? loopVolumeCurveBehavior : 'repeat');
|
|
73
73
|
if (!src) {
|
|
74
74
|
throw new TypeError("No 'src' was passed to <Html5Audio>.");
|
|
@@ -82,6 +82,11 @@ const AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
82
82
|
volume,
|
|
83
83
|
mediaVolume,
|
|
84
84
|
});
|
|
85
|
+
const { isMutedForTimeline, isMutedForPlayback } = (0, use_media_audio_state_js_1.useMediaAudioState)({
|
|
86
|
+
muted: muted !== null && muted !== void 0 ? muted : false,
|
|
87
|
+
volume: userPreferredVolume,
|
|
88
|
+
audioEnabled: true,
|
|
89
|
+
});
|
|
85
90
|
(0, volume_safeguard_js_1.warnAboutTooHighVolume)(userPreferredVolume);
|
|
86
91
|
const crossOriginValue = (0, get_cross_origin_value_js_1.getCrossOriginValue)({
|
|
87
92
|
crossOrigin,
|
|
@@ -90,7 +95,7 @@ const AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
90
95
|
});
|
|
91
96
|
const propsToPass = (0, react_2.useMemo)(() => {
|
|
92
97
|
return {
|
|
93
|
-
muted:
|
|
98
|
+
muted: isMutedForPlayback,
|
|
94
99
|
src: preloadedSrc,
|
|
95
100
|
loop: _remotionInternalNativeLoopPassed,
|
|
96
101
|
crossOrigin: crossOriginValue,
|
|
@@ -98,11 +103,9 @@ const AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
98
103
|
};
|
|
99
104
|
}, [
|
|
100
105
|
_remotionInternalNativeLoopPassed,
|
|
101
|
-
|
|
102
|
-
muted,
|
|
106
|
+
isMutedForPlayback,
|
|
103
107
|
nativeProps,
|
|
104
108
|
preloadedSrc,
|
|
105
|
-
userPreferredVolume,
|
|
106
109
|
crossOriginValue,
|
|
107
110
|
]);
|
|
108
111
|
// Generate a string that's as unique as possible for this asset
|
|
@@ -139,7 +142,7 @@ const AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
139
142
|
loopDisplay: undefined,
|
|
140
143
|
documentationLink: 'https://www.remotion.dev/docs/html5-audio',
|
|
141
144
|
refForOutline: null,
|
|
142
|
-
muted:
|
|
145
|
+
muted: isMutedForTimeline,
|
|
143
146
|
});
|
|
144
147
|
// putting playback before useVolume
|
|
145
148
|
// because volume looks at playbackrate
|
|
@@ -10,10 +10,13 @@ const SequenceContext_js_1 = require("../SequenceContext.js");
|
|
|
10
10
|
const timeline_position_state_js_1 = require("../timeline-position-state.js");
|
|
11
11
|
const use_current_frame_js_1 = require("../use-current-frame.js");
|
|
12
12
|
const use_delay_render_js_1 = require("../use-delay-render.js");
|
|
13
|
+
const use_media_enabled_js_1 = require("../use-media-enabled.js");
|
|
13
14
|
const volume_prop_js_1 = require("../volume-prop.js");
|
|
14
15
|
const volume_safeguard_js_1 = require("../volume-safeguard.js");
|
|
15
16
|
const use_audio_frame_js_1 = require("./use-audio-frame.js");
|
|
17
|
+
const use_media_audio_state_js_1 = require("./use-media-audio-state.js");
|
|
16
18
|
const AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
19
|
+
var _a;
|
|
17
20
|
const audioRef = (0, react_1.useRef)(null);
|
|
18
21
|
const { volume: volumeProp, playbackRate, allowAmplificationDuringRender, onDuration, toneFrequency, _remotionInternalNeedsDurationCalculation, _remotionInternalNativeLoopPassed, acceptableTimeShiftInSeconds, name, onNativeError, delayRenderRetries, delayRenderTimeoutInMilliseconds, loopVolumeCurveBehavior, pauseWhenBuffering, audioStreamIndex, preservePitch: _preservePitch, ...nativeProps } = props;
|
|
19
22
|
const absoluteFrame = (0, timeline_position_state_js_1.useTimelinePosition)();
|
|
@@ -39,6 +42,12 @@ const AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
39
42
|
mediaVolume: 1,
|
|
40
43
|
});
|
|
41
44
|
(0, volume_safeguard_js_1.warnAboutTooHighVolume)(volume);
|
|
45
|
+
const audioEnabled = (0, use_media_enabled_js_1.useAudioEnabled)();
|
|
46
|
+
const { shouldUseAudio } = (0, use_media_audio_state_js_1.useMediaAudioState)({
|
|
47
|
+
muted: (_a = props.muted) !== null && _a !== void 0 ? _a : false,
|
|
48
|
+
volume,
|
|
49
|
+
audioEnabled,
|
|
50
|
+
});
|
|
42
51
|
(0, react_1.useImperativeHandle)(ref, () => {
|
|
43
52
|
return audioRef.current;
|
|
44
53
|
}, []);
|
|
@@ -47,13 +56,7 @@ const AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
47
56
|
if (!props.src) {
|
|
48
57
|
throw new Error('No src passed');
|
|
49
58
|
}
|
|
50
|
-
if (!
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
if (props.muted) {
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
if (volume <= 0) {
|
|
59
|
+
if (!shouldUseAudio) {
|
|
57
60
|
return;
|
|
58
61
|
}
|
|
59
62
|
registerRenderAsset({
|
|
@@ -70,7 +73,7 @@ const AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
70
73
|
});
|
|
71
74
|
return () => unregisterRenderAsset(id);
|
|
72
75
|
}, [
|
|
73
|
-
|
|
76
|
+
shouldUseAudio,
|
|
74
77
|
props.src,
|
|
75
78
|
registerRenderAsset,
|
|
76
79
|
absoluteFrame,
|
|
@@ -67,8 +67,8 @@ const didPropChange = (key, newProp, prevProp) => {
|
|
|
67
67
|
if (key === 'src' &&
|
|
68
68
|
!prevProp.startsWith('data:') &&
|
|
69
69
|
!newProp.startsWith('data:')) {
|
|
70
|
-
return (new URL(prevProp,
|
|
71
|
-
new URL(newProp,
|
|
70
|
+
return (new URL(prevProp, document.baseURI).toString() !==
|
|
71
|
+
new URL(newProp, document.baseURI).toString());
|
|
72
72
|
}
|
|
73
73
|
if (prevProp === newProp) {
|
|
74
74
|
return false;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type MediaAudioState = {
|
|
2
|
+
readonly isMutedForTimeline: boolean;
|
|
3
|
+
readonly isMutedForPlayback: boolean;
|
|
4
|
+
readonly shouldUseAudio: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const resolveMediaAudioState: ({ muted, playerMuted, volume, isInsideFreeze, audioEnabled, }: {
|
|
7
|
+
readonly muted: boolean;
|
|
8
|
+
readonly playerMuted: boolean;
|
|
9
|
+
readonly volume: number | null;
|
|
10
|
+
readonly isInsideFreeze: boolean;
|
|
11
|
+
readonly audioEnabled: boolean;
|
|
12
|
+
}) => MediaAudioState;
|
|
13
|
+
export declare const useMediaAudioState: ({ muted, volume, audioEnabled, }: {
|
|
14
|
+
readonly muted: boolean;
|
|
15
|
+
readonly volume: number | null;
|
|
16
|
+
readonly audioEnabled: boolean;
|
|
17
|
+
}) => MediaAudioState;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useMediaAudioState = exports.resolveMediaAudioState = void 0;
|
|
4
|
+
const timeline_position_state_js_1 = require("../timeline-position-state.js");
|
|
5
|
+
const volume_position_state_js_1 = require("../volume-position-state.js");
|
|
6
|
+
const resolveMediaAudioState = ({ muted, playerMuted, volume, isInsideFreeze, audioEnabled, }) => {
|
|
7
|
+
const isMutedForTimeline = muted || isInsideFreeze;
|
|
8
|
+
const isMutedForPlayback = isMutedForTimeline || playerMuted || (volume !== null && volume <= 0);
|
|
9
|
+
return {
|
|
10
|
+
isMutedForTimeline,
|
|
11
|
+
isMutedForPlayback,
|
|
12
|
+
shouldUseAudio: audioEnabled && !isMutedForPlayback,
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
exports.resolveMediaAudioState = resolveMediaAudioState;
|
|
16
|
+
const useMediaAudioState = ({ muted, volume, audioEnabled, }) => {
|
|
17
|
+
const [playerMuted] = (0, volume_position_state_js_1.usePlayerMutedState)();
|
|
18
|
+
const isInsideFreeze = (0, timeline_position_state_js_1.useIsInsideFreeze)();
|
|
19
|
+
return (0, exports.resolveMediaAudioState)({
|
|
20
|
+
muted,
|
|
21
|
+
playerMuted,
|
|
22
|
+
volume,
|
|
23
|
+
isInsideFreeze,
|
|
24
|
+
audioEnabled,
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
exports.useMediaAudioState = useMediaAudioState;
|
|
@@ -219,6 +219,7 @@ export declare const canvasImageSchema: {
|
|
|
219
219
|
};
|
|
220
220
|
export declare const CanvasImage: import("react").ComponentType<import("../Interactive.js").InteractiveBaseProps & import("../Interactive.js").InteractiveCropProps & import("../Interactive.js").InteractivePremountProps & CanvasImageCanvasProps & {
|
|
221
221
|
readonly src: string;
|
|
222
|
+
readonly crossOrigin?: "" | "anonymous" | "use-credentials" | undefined;
|
|
222
223
|
readonly width?: number | undefined;
|
|
223
224
|
readonly height?: number | undefined;
|
|
224
225
|
readonly fit?: import("../calculate-image-fit.js").ImageFit | undefined;
|
|
@@ -53,7 +53,7 @@ const makeAbortError = () => {
|
|
|
53
53
|
error.name = 'AbortError';
|
|
54
54
|
return error;
|
|
55
55
|
};
|
|
56
|
-
const loadImage = ({ src, signal, }) => {
|
|
56
|
+
const loadImage = ({ src, signal, crossOrigin, }) => {
|
|
57
57
|
return new Promise((resolve, reject) => {
|
|
58
58
|
const image = new Image();
|
|
59
59
|
let settled = false;
|
|
@@ -94,7 +94,7 @@ const loadImage = ({ src, signal, }) => {
|
|
|
94
94
|
onAbort();
|
|
95
95
|
return;
|
|
96
96
|
}
|
|
97
|
-
image.crossOrigin = 'anonymous';
|
|
97
|
+
image.crossOrigin = crossOrigin !== null && crossOrigin !== void 0 ? crossOrigin : 'anonymous';
|
|
98
98
|
image.src = src;
|
|
99
99
|
});
|
|
100
100
|
};
|
|
@@ -109,7 +109,7 @@ const waitForNextFrame = ({ onFrame, }) => {
|
|
|
109
109
|
const frame = requestAnimationFrame(onFrame);
|
|
110
110
|
return () => cancelAnimationFrame(frame);
|
|
111
111
|
};
|
|
112
|
-
const CanvasImageContent = (0, react_1.forwardRef)(({ src, width, height, fit = 'fill', effects, controls, onError, className, style, id, pauseWhenLoading, maxRetries = 2, delayRenderRetries, delayRenderTimeoutInMilliseconds, refForOutline, ...canvasProps }, ref) => {
|
|
112
|
+
const CanvasImageContent = (0, react_1.forwardRef)(({ src, crossOrigin, width, height, fit = 'fill', effects, controls, onError, className, style, id, pauseWhenLoading, maxRetries = 2, delayRenderRetries, delayRenderTimeoutInMilliseconds, refForOutline, ...canvasProps }, ref) => {
|
|
113
113
|
var _a;
|
|
114
114
|
const { delayRender, continueRender, cancelRender } = (0, use_delay_render_js_1.useDelayRender)();
|
|
115
115
|
const { delayPlayback } = (0, use_buffer_state_js_1.useBufferState)();
|
|
@@ -187,7 +187,7 @@ const CanvasImageContent = (0, react_1.forwardRef)(({ src, width, height, fit =
|
|
|
187
187
|
continued: false,
|
|
188
188
|
};
|
|
189
189
|
const attemptLoad = () => {
|
|
190
|
-
loadImage({ src: actualSrc, signal: controller.signal })
|
|
190
|
+
loadImage({ src: actualSrc, signal: controller.signal, crossOrigin })
|
|
191
191
|
.then((image) => {
|
|
192
192
|
if (cancelled) {
|
|
193
193
|
return;
|
|
@@ -232,6 +232,7 @@ const CanvasImageContent = (0, react_1.forwardRef)(({ src, width, height, fit =
|
|
|
232
232
|
actualSrc,
|
|
233
233
|
cancelRender,
|
|
234
234
|
continuePendingLoadDelay,
|
|
235
|
+
crossOrigin,
|
|
235
236
|
delayRender,
|
|
236
237
|
delayRenderRetries,
|
|
237
238
|
delayRenderTimeoutInMilliseconds,
|
|
@@ -329,10 +330,14 @@ const CanvasImageContent = (0, react_1.forwardRef)(({ src, width, height, fit =
|
|
|
329
330
|
return (jsx_runtime_1.jsx("canvas", { ...canvasProps, ref: canvasRef, width: width, height: height, className: className, style: style, id: id }));
|
|
330
331
|
});
|
|
331
332
|
CanvasImageContent.displayName = 'CanvasImageContent';
|
|
332
|
-
const CanvasImageInner = (0, react_1.forwardRef)(({ src, width, height, fit, effects = [], className, style, id, onError, pauseWhenLoading, maxRetries, delayRenderRetries, delayRenderTimeoutInMilliseconds, durationInFrames, from, trimBefore, freeze, premountFor, postmountFor, styleWhilePremounted, styleWhilePostmounted, hidden, name, showInTimeline, cropLeft, cropRight, cropTop, cropBottom, controls, _remotionInternalDocumentationLink, _remotionInternalCropComponentName, outlineRef, ...canvasProps }, ref) => {
|
|
333
|
+
const CanvasImageInner = (0, react_1.forwardRef)(({ src, crossOrigin, width, height, fit, effects = [], className, style, id, onError, pauseWhenLoading, maxRetries, delayRenderRetries, delayRenderTimeoutInMilliseconds, durationInFrames, from, trimBefore, freeze, premountFor, postmountFor, styleWhilePremounted, styleWhilePostmounted, hidden, name, showInTimeline, cropLeft, cropRight, cropTop, cropBottom, controls, _remotionInternalDocumentationLink, _remotionInternalCropComponentName, outlineRef, ...canvasProps }, ref) => {
|
|
333
334
|
if (!src) {
|
|
334
335
|
throw new Error('No "src" prop was passed to <CanvasImage>.');
|
|
335
336
|
}
|
|
337
|
+
const isMedia = (0, react_1.useMemo)(() => ({
|
|
338
|
+
type: 'image',
|
|
339
|
+
src,
|
|
340
|
+
}), [src]);
|
|
336
341
|
const memoizedEffectDefinitions = (0, use_memoized_effects_js_1.useMemoizedEffectDefinitions)(effects);
|
|
337
342
|
const actualRef = (0, react_1.useRef)(null);
|
|
338
343
|
(0, react_1.useImperativeHandle)(ref, () => {
|
|
@@ -356,7 +361,7 @@ const CanvasImageInner = (0, react_1.forwardRef)(({ src, width, height, fit, eff
|
|
|
356
361
|
style: premountingStyle,
|
|
357
362
|
componentName: _remotionInternalCropComponentName !== null && _remotionInternalCropComponentName !== void 0 ? _remotionInternalCropComponentName : '<CanvasImage />',
|
|
358
363
|
});
|
|
359
|
-
return (jsx_runtime_1.jsx(freeze_js_1.Freeze, { frame: freezeFrame, active: isPremountingOrPostmounting, children: jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", from: from !== null && from !== void 0 ? from : 0, trimBefore: trimBefore, durationInFrames: durationInFrames !== null && durationInFrames !== void 0 ? durationInFrames : Infinity, freeze: freeze, hidden: hidden, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, name: name !== null && name !== void 0 ? name : '<CanvasImage>', _remotionInternalDocumentationLink: _remotionInternalDocumentationLink !== null && _remotionInternalDocumentationLink !== void 0 ? _remotionInternalDocumentationLink : 'https://www.remotion.dev/docs/canvasimage', controls: controls, _remotionInternalEffects: memoizedEffectDefinitions, _remotionInternalIsMedia:
|
|
364
|
+
return (jsx_runtime_1.jsx(freeze_js_1.Freeze, { frame: freezeFrame, active: isPremountingOrPostmounting, children: jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", from: from !== null && from !== void 0 ? from : 0, trimBefore: trimBefore, durationInFrames: durationInFrames !== null && durationInFrames !== void 0 ? durationInFrames : Infinity, freeze: freeze, hidden: hidden, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, name: name !== null && name !== void 0 ? name : '<CanvasImage>', _remotionInternalDocumentationLink: _remotionInternalDocumentationLink !== null && _remotionInternalDocumentationLink !== void 0 ? _remotionInternalDocumentationLink : 'https://www.remotion.dev/docs/canvasimage', controls: controls, _remotionInternalEffects: memoizedEffectDefinitions, _remotionInternalIsMedia: isMedia, _remotionInternalPremountDisplay: effectivePremountFor || null, _remotionInternalPostmountDisplay: effectivePostmountFor || null, _remotionInternalIsPremounting: premountingActive, _remotionInternalIsPostmounting: postmountingActive, outlineRef: outlineRef !== null && outlineRef !== void 0 ? outlineRef : actualRef, children: jsx_runtime_1.jsx(CanvasImageContent, { ref: actualRef, src: src, crossOrigin: crossOrigin, width: width, height: height, fit: fit, effects: effects, controls: controls, className: className, style: croppedStyle !== null && croppedStyle !== void 0 ? croppedStyle : undefined, id: id, onError: onError, pauseWhenLoading: pauseWhenLoading, maxRetries: maxRetries, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds, refForOutline: outlineRef !== null && outlineRef !== void 0 ? outlineRef : null, ...canvasProps }) }) }));
|
|
360
365
|
});
|
|
361
366
|
/*
|
|
362
367
|
* @description Renders a static image to a `<canvas>` and applies Remotion effects.
|
|
@@ -6,6 +6,7 @@ type CanvasImageSequenceProps = InteractiveBaseProps & InteractiveCropProps & In
|
|
|
6
6
|
export type CanvasImageCanvasProps = Omit<React.CanvasHTMLAttributes<HTMLCanvasElement>, 'children' | 'height' | 'onError' | 'width'>;
|
|
7
7
|
export type CanvasImageProps = CanvasImageSequenceProps & CanvasImageCanvasProps & {
|
|
8
8
|
readonly src: string;
|
|
9
|
+
readonly crossOrigin?: React.ImgHTMLAttributes<HTMLImageElement>['crossOrigin'];
|
|
9
10
|
readonly width?: number;
|
|
10
11
|
readonly height?: number;
|
|
11
12
|
readonly fit?: ImageFit;
|
package/dist/cjs/delay-render.js
CHANGED
|
@@ -30,7 +30,7 @@ const delayRenderInternal = ({ scope, environment, label, options, }) => {
|
|
|
30
30
|
scope.remotion_delayRenderHandles.push(handle);
|
|
31
31
|
const called = (_b = (_a = Error().stack) === null || _a === void 0 ? void 0 : _a.replace(/^Error/g, '')) !== null && _b !== void 0 ? _b : '';
|
|
32
32
|
if (environment.isRendering) {
|
|
33
|
-
const timeoutToUse = ((_d = (_c = options === null || options === void 0 ? void 0 : options.timeoutInMilliseconds) !== null && _c !== void 0 ? _c : scope.remotion_puppeteerTimeout) !== null && _d !== void 0 ? _d : defaultTimeout) - 2000;
|
|
33
|
+
const timeoutToUse = Math.max(0, ((_d = (_c = options === null || options === void 0 ? void 0 : options.timeoutInMilliseconds) !== null && _c !== void 0 ? _c : scope.remotion_puppeteerTimeout) !== null && _d !== void 0 ? _d : defaultTimeout) - 2000);
|
|
34
34
|
const retriesLeft = ((_e = options === null || options === void 0 ? void 0 : options.retries) !== null && _e !== void 0 ? _e : 0) - (scope.remotion_attempt - 1);
|
|
35
35
|
scope.remotion_delayRenderTimeouts[handle] = {
|
|
36
36
|
label: label !== null && label !== void 0 ? label : null,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type RegisteredFontFace = {
|
|
2
|
+
ascentOverride: string | null;
|
|
3
|
+
descentOverride: string | null;
|
|
4
|
+
display: 'auto' | 'block' | 'fallback' | 'optional' | 'swap' | null;
|
|
5
|
+
featureSettings: string | null;
|
|
6
|
+
fontFamily: string;
|
|
7
|
+
fontData: ArrayBuffer;
|
|
8
|
+
fontUrl: string;
|
|
9
|
+
format: 'woff2' | 'woff' | 'opentype' | 'truetype';
|
|
10
|
+
lineGapOverride: string | null;
|
|
11
|
+
style: string | null;
|
|
12
|
+
weight: string | null;
|
|
13
|
+
stretch: string | null;
|
|
14
|
+
unicodeRange: string | null;
|
|
15
|
+
variant: string | null;
|
|
16
|
+
};
|
|
17
|
+
export declare const fetchFontData: (fontUrl: string) => Promise<ArrayBuffer>;
|
|
18
|
+
export declare const registerFontFace: (fontFace: RegisteredFontFace) => void;
|
|
19
|
+
export declare const getRegisteredFontFaces: () => RegisteredFontFace[];
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRegisteredFontFaces = exports.registerFontFace = exports.fetchFontData = void 0;
|
|
4
|
+
const registeredFontFaces = [];
|
|
5
|
+
const fontDataByUrl = new Map();
|
|
6
|
+
const fetchFontData = (fontUrl) => {
|
|
7
|
+
const cached = fontDataByUrl.get(fontUrl);
|
|
8
|
+
if (cached) {
|
|
9
|
+
return cached;
|
|
10
|
+
}
|
|
11
|
+
const promise = fetch(fontUrl)
|
|
12
|
+
.then((response) => {
|
|
13
|
+
if (!response.ok) {
|
|
14
|
+
throw new Error(`Failed to load font ${JSON.stringify(fontUrl)}: ${response.status} ${response.statusText}`);
|
|
15
|
+
}
|
|
16
|
+
return response.arrayBuffer();
|
|
17
|
+
})
|
|
18
|
+
.catch((error) => {
|
|
19
|
+
fontDataByUrl.delete(fontUrl);
|
|
20
|
+
throw error;
|
|
21
|
+
});
|
|
22
|
+
fontDataByUrl.set(fontUrl, promise);
|
|
23
|
+
return promise;
|
|
24
|
+
};
|
|
25
|
+
exports.fetchFontData = fetchFontData;
|
|
26
|
+
const registerFontFace = (fontFace) => {
|
|
27
|
+
if (registeredFontFaces.some((registered) => registered.ascentOverride === fontFace.ascentOverride &&
|
|
28
|
+
registered.descentOverride === fontFace.descentOverride &&
|
|
29
|
+
registered.display === fontFace.display &&
|
|
30
|
+
registered.featureSettings === fontFace.featureSettings &&
|
|
31
|
+
registered.fontFamily === fontFace.fontFamily &&
|
|
32
|
+
registered.fontUrl === fontFace.fontUrl &&
|
|
33
|
+
registered.format === fontFace.format &&
|
|
34
|
+
registered.lineGapOverride === fontFace.lineGapOverride &&
|
|
35
|
+
registered.style === fontFace.style &&
|
|
36
|
+
registered.weight === fontFace.weight &&
|
|
37
|
+
registered.stretch === fontFace.stretch &&
|
|
38
|
+
registered.unicodeRange === fontFace.unicodeRange &&
|
|
39
|
+
registered.variant === fontFace.variant)) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
registeredFontFaces.push(fontFace);
|
|
43
|
+
};
|
|
44
|
+
exports.registerFontFace = registerFontFace;
|
|
45
|
+
const getRegisteredFontFaces = () => {
|
|
46
|
+
return registeredFontFaces.slice();
|
|
47
|
+
};
|
|
48
|
+
exports.getRegisteredFontFaces = getRegisteredFontFaces;
|
package/dist/cjs/freeze.js
CHANGED
|
@@ -101,7 +101,7 @@ export type FontWeightFieldSchema = {
|
|
|
101
101
|
type: 'font-weight';
|
|
102
102
|
default: number | string | undefined;
|
|
103
103
|
description?: string;
|
|
104
|
-
keyframable?:
|
|
104
|
+
keyframable?: boolean;
|
|
105
105
|
};
|
|
106
106
|
export type AssetFieldSchema = {
|
|
107
107
|
type: 'asset';
|
|
@@ -265,7 +265,6 @@ export declare const textSchema: {
|
|
|
265
265
|
readonly type: "font-weight";
|
|
266
266
|
readonly default: 400;
|
|
267
267
|
readonly description: "Font weight";
|
|
268
|
-
readonly keyframable: false;
|
|
269
268
|
};
|
|
270
269
|
readonly 'style.fontStyle': {
|
|
271
270
|
readonly type: "enum";
|
package/dist/cjs/internals.d.ts
CHANGED
|
@@ -42,6 +42,12 @@ export declare const Internals: {
|
|
|
42
42
|
readonly useFrameForVolumeProp: (behavior: import("./index.js").LoopVolumeCurveBehavior) => number;
|
|
43
43
|
readonly useTimelinePosition: () => number;
|
|
44
44
|
readonly useAbsoluteTimelinePosition: () => number;
|
|
45
|
+
readonly useIsInsideFreeze: () => boolean;
|
|
46
|
+
readonly useMediaAudioState: ({ muted, volume, audioEnabled, }: {
|
|
47
|
+
readonly muted: boolean;
|
|
48
|
+
readonly volume: number | null;
|
|
49
|
+
readonly audioEnabled: boolean;
|
|
50
|
+
}) => import("./audio/use-media-audio-state.js").MediaAudioState;
|
|
45
51
|
readonly evaluateVolume: ({ frame, volume, mediaVolume, }: {
|
|
46
52
|
frame: number;
|
|
47
53
|
volume: import("./volume-prop.js").VolumeProp | undefined;
|
|
@@ -648,7 +654,6 @@ export declare const Internals: {
|
|
|
648
654
|
readonly type: "font-weight";
|
|
649
655
|
readonly default: 400;
|
|
650
656
|
readonly description: "Font weight";
|
|
651
|
-
readonly keyframable: false;
|
|
652
657
|
};
|
|
653
658
|
readonly 'style.fontStyle': {
|
|
654
659
|
readonly type: "enum";
|
package/dist/cjs/internals.js
CHANGED
|
@@ -41,6 +41,7 @@ const get_duration_in_seconds_js_1 = require("./animated-image/get-duration-in-s
|
|
|
41
41
|
const AudioForPreview_js_1 = require("./audio/AudioForPreview.js");
|
|
42
42
|
const shared_audio_tags_js_1 = require("./audio/shared-audio-tags.js");
|
|
43
43
|
const use_audio_frame_js_1 = require("./audio/use-audio-frame.js");
|
|
44
|
+
const use_media_audio_state_js_1 = require("./audio/use-media-audio-state.js");
|
|
44
45
|
const buffering_js_1 = require("./buffering.js");
|
|
45
46
|
const calculate_media_duration_js_1 = require("./calculate-media-duration.js");
|
|
46
47
|
const CanUseRemotionHooks_js_1 = require("./CanUseRemotionHooks.js");
|
|
@@ -143,6 +144,8 @@ exports.Internals = {
|
|
|
143
144
|
useFrameForVolumeProp: use_audio_frame_js_1.useFrameForVolumeProp,
|
|
144
145
|
useTimelinePosition: TimelinePosition.useTimelinePosition,
|
|
145
146
|
useAbsoluteTimelinePosition: TimelinePosition.useAbsoluteTimelinePosition,
|
|
147
|
+
useIsInsideFreeze: TimelinePosition.useIsInsideFreeze,
|
|
148
|
+
useMediaAudioState: use_media_audio_state_js_1.useMediaAudioState,
|
|
146
149
|
evaluateVolume: volume_prop_js_1.evaluateVolume,
|
|
147
150
|
getAbsoluteSrc: absolute_src_js_1.getAbsoluteSrc,
|
|
148
151
|
getAnimatedImageDurationInSeconds: get_duration_in_seconds_js_1.getAnimatedImageDurationInSeconds,
|
package/dist/cjs/no-react.d.ts
CHANGED
|
@@ -273,4 +273,7 @@ export declare const NoReactInternals: {
|
|
|
273
273
|
};
|
|
274
274
|
parseScaleValue: (value: unknown) => import("./scale-value").ScaleValue;
|
|
275
275
|
serializeScaleValue: ([x, y, z]: import("./scale-value").ScaleValue) => string | number;
|
|
276
|
+
getRegisteredFontFaces: () => import("./font-face-registry").RegisteredFontFace[];
|
|
277
|
+
registerFontFace: (fontFace: import("./font-face-registry").RegisteredFontFace) => void;
|
|
278
|
+
fetchFontData: (fontUrl: string) => Promise<ArrayBuffer>;
|
|
276
279
|
};
|
package/dist/cjs/no-react.js
CHANGED
|
@@ -9,6 +9,7 @@ const random_js_1 = require("./random.js");
|
|
|
9
9
|
Object.defineProperty(exports, "random", { enumerable: true, get: function () { return random_js_1.random; } });
|
|
10
10
|
const delay_render_constants_1 = require("./delay-render-constants");
|
|
11
11
|
const find_props_to_delete_1 = require("./find-props-to-delete");
|
|
12
|
+
const font_face_registry_1 = require("./font-face-registry");
|
|
12
13
|
const input_props_serialization_1 = require("./input-props-serialization");
|
|
13
14
|
const input_props_serialization_js_1 = require("./input-props-serialization.js");
|
|
14
15
|
const interactivity_schema_1 = require("./interactivity-schema");
|
|
@@ -56,4 +57,7 @@ exports.NoReactInternals = {
|
|
|
56
57
|
sequenceSchema: interactivity_schema_1.sequenceSchema,
|
|
57
58
|
parseScaleValue: scale_value_1.parseScaleValue,
|
|
58
59
|
serializeScaleValue: scale_value_1.serializeScaleValue,
|
|
60
|
+
getRegisteredFontFaces: font_face_registry_1.getRegisteredFontFaces,
|
|
61
|
+
registerFontFace: font_face_registry_1.registerFontFace,
|
|
62
|
+
fetchFontData: font_face_registry_1.fetchFontData,
|
|
59
63
|
};
|