remotion 4.0.114 → 4.0.116
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/AudioForDevelopment.d.ts +1 -1
- package/dist/cjs/use-buffer.d.ts +5 -0
- package/dist/cjs/use-buffer.js +28 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/video/VideoForDevelopment.d.ts +1 -1
- package/dist/cjs/watch-static-file.js +8 -2
- package/dist/esm/index.mjs +9 -3
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/dist/cjs/get-timeline-clip-name.d.ts +0 -1
- package/dist/cjs/get-timeline-clip-name.js +0 -25
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export declare const AudioForDevelopment: ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>, "
|
|
3
|
+
export declare const AudioForDevelopment: ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>, "autoPlay" | "controls" | "onEnded" | "nonce" | "onResize" | "onResizeCapture"> & {
|
|
4
4
|
name?: string | undefined;
|
|
5
5
|
volume?: import("../volume-prop.js").VolumeProp | undefined;
|
|
6
6
|
playbackRate?: number | undefined;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useBufferState = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const buffering_1 = require("./buffering");
|
|
6
|
+
const CanUseRemotionHooks_1 = require("./CanUseRemotionHooks");
|
|
7
|
+
const useBufferState = () => {
|
|
8
|
+
const canUseRemotionHooks = (0, react_1.useContext)(CanUseRemotionHooks_1.CanUseRemotionHooks);
|
|
9
|
+
if (!canUseRemotionHooks) {
|
|
10
|
+
if (typeof window !== 'undefined' && window.remotion_isPlayer) {
|
|
11
|
+
throw new Error(`useCurrentFrame can only be called inside a component that was passed to <Player>. See: https://www.remotion.dev/docs/player/examples`);
|
|
12
|
+
}
|
|
13
|
+
throw new Error(`useCurrentFrame() can only be called inside a component that was registered as a composition. See https://www.remotion.dev/docs/the-fundamentals#defining-compositions`);
|
|
14
|
+
}
|
|
15
|
+
const buffer = (0, react_1.useContext)(buffering_1.BufferingContextReact);
|
|
16
|
+
if (!buffer) {
|
|
17
|
+
throw new Error('BufferingContextReact was unexpectedly not found. Most likely your Remotion versions are mismatching.');
|
|
18
|
+
}
|
|
19
|
+
return (0, react_1.useMemo)(() => ({
|
|
20
|
+
delayPlayback: () => {
|
|
21
|
+
const { unblock } = buffer.addBlock({
|
|
22
|
+
id: String(Math.random()),
|
|
23
|
+
});
|
|
24
|
+
return { unblock };
|
|
25
|
+
},
|
|
26
|
+
}), [buffer]);
|
|
27
|
+
};
|
|
28
|
+
exports.useBufferState = useBufferState;
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "4.0.
|
|
1
|
+
export declare const VERSION = "4.0.116";
|
package/dist/cjs/version.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export declare const VideoForDevelopment: ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>, "
|
|
3
|
+
export declare const VideoForDevelopment: ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>, "autoPlay" | "controls" | "onEnded" | "nonce"> & {
|
|
4
4
|
name?: string | undefined;
|
|
5
5
|
volume?: import("../volume-prop.js").VolumeProp | undefined;
|
|
6
6
|
playbackRate?: number | undefined;
|
|
@@ -17,12 +17,18 @@ const watchStaticFile = (fileName, callback) => {
|
|
|
17
17
|
console.warn('The API is only available while using the Remotion Studio.');
|
|
18
18
|
return { cancel: () => undefined };
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
const withoutStaticBase = fileName.startsWith(window.remotion_staticBase)
|
|
21
|
+
? fileName.replace(window.remotion_staticBase, '')
|
|
22
|
+
: fileName;
|
|
23
|
+
const withoutLeadingSlash = withoutStaticBase.startsWith('/')
|
|
24
|
+
? withoutStaticBase.slice(1)
|
|
25
|
+
: withoutStaticBase;
|
|
26
|
+
let prevFileData = window.remotion_staticFiles.find((file) => file.name === withoutLeadingSlash);
|
|
21
27
|
// Check if the specified static file has updated or deleted
|
|
22
28
|
const checkFile = (event) => {
|
|
23
29
|
const staticFiles = event.detail.files;
|
|
24
30
|
// Check for user specified file
|
|
25
|
-
const newFileData = staticFiles.find((file) => file.name ===
|
|
31
|
+
const newFileData = staticFiles.find((file) => file.name === withoutLeadingSlash);
|
|
26
32
|
if (!newFileData) {
|
|
27
33
|
// File is deleted
|
|
28
34
|
if (prevFileData !== undefined) {
|
package/dist/esm/index.mjs
CHANGED
|
@@ -105,7 +105,7 @@ function truthy(value) {
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
// Automatically generated on publish
|
|
108
|
-
const VERSION = '4.0.
|
|
108
|
+
const VERSION = '4.0.116';
|
|
109
109
|
|
|
110
110
|
const checkMultipleRemotionVersions = () => {
|
|
111
111
|
if (typeof globalThis === 'undefined') {
|
|
@@ -4142,12 +4142,18 @@ const watchStaticFile = (fileName, callback) => {
|
|
|
4142
4142
|
console.warn('The API is only available while using the Remotion Studio.');
|
|
4143
4143
|
return { cancel: () => undefined };
|
|
4144
4144
|
}
|
|
4145
|
-
|
|
4145
|
+
const withoutStaticBase = fileName.startsWith(window.remotion_staticBase)
|
|
4146
|
+
? fileName.replace(window.remotion_staticBase, '')
|
|
4147
|
+
: fileName;
|
|
4148
|
+
const withoutLeadingSlash = withoutStaticBase.startsWith('/')
|
|
4149
|
+
? withoutStaticBase.slice(1)
|
|
4150
|
+
: withoutStaticBase;
|
|
4151
|
+
let prevFileData = window.remotion_staticFiles.find((file) => file.name === withoutLeadingSlash);
|
|
4146
4152
|
// Check if the specified static file has updated or deleted
|
|
4147
4153
|
const checkFile = (event) => {
|
|
4148
4154
|
const staticFiles = event.detail.files;
|
|
4149
4155
|
// Check for user specified file
|
|
4150
|
-
const newFileData = staticFiles.find((file) => file.name ===
|
|
4156
|
+
const newFileData = staticFiles.find((file) => file.name === withoutLeadingSlash);
|
|
4151
4157
|
if (!newFileData) {
|
|
4152
4158
|
// File is deleted
|
|
4153
4159
|
if (prevFileData !== undefined) {
|
package/dist/esm/version.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getTimelineClipName: (children: React.ReactNode) => string;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTimelineClipName = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const HIDDEN_NAMES = ['__WEBPACK_DEFAULT_EXPORT__'];
|
|
6
|
-
const getTimelineClipName = (children) => {
|
|
7
|
-
var _a;
|
|
8
|
-
const tree = (_a = react_1.Children.map(children, (ch) => {
|
|
9
|
-
if (!(0, react_1.isValidElement)(ch)) {
|
|
10
|
-
return null;
|
|
11
|
-
}
|
|
12
|
-
// Must be name, not ID
|
|
13
|
-
const name = typeof ch.type !== 'string' && ch.type.name;
|
|
14
|
-
if (name && !HIDDEN_NAMES.includes(name)) {
|
|
15
|
-
return name;
|
|
16
|
-
}
|
|
17
|
-
if (ch.props.children) {
|
|
18
|
-
const chName = (0, exports.getTimelineClipName)(ch.props.children);
|
|
19
|
-
return chName;
|
|
20
|
-
}
|
|
21
|
-
return null;
|
|
22
|
-
})) === null || _a === void 0 ? void 0 : _a.filter(Boolean);
|
|
23
|
-
return (tree === null || tree === void 0 ? void 0 : tree.length) ? tree[0] : '';
|
|
24
|
-
};
|
|
25
|
-
exports.getTimelineClipName = getTimelineClipName;
|