@remotion/studio 4.0.452 → 4.0.454
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/audio-waveform-worker.d.ts +1 -0
- package/dist/audio-waveform-worker.js +102 -0
- package/dist/components/AudioWaveform.d.ts +2 -0
- package/dist/components/AudioWaveform.js +168 -18
- package/dist/components/CurrentAsset.js +13 -5
- package/dist/components/Timeline/LoopedIndicator.js +5 -19
- package/dist/components/Timeline/TimelineSequence.js +18 -10
- package/dist/components/Timeline/TimelineVideoInfo.d.ts +2 -0
- package/dist/components/Timeline/TimelineVideoInfo.js +51 -12
- package/dist/components/audio-waveform-worker-types.d.ts +28 -0
- package/dist/components/audio-waveform-worker-types.js +2 -0
- package/dist/components/draw-peaks.d.ts +1 -1
- package/dist/components/load-waveform-peaks.d.ts +11 -1
- package/dist/components/load-waveform-peaks.js +33 -36
- package/dist/components/looped-media-timeline.d.ts +6 -0
- package/dist/components/looped-media-timeline.js +14 -0
- package/dist/components/slice-waveform-peaks.d.ts +7 -0
- package/dist/components/slice-waveform-peaks.js +15 -0
- package/dist/components/waveform-peak-processor.d.ts +23 -0
- package/dist/components/waveform-peak-processor.js +77 -0
- package/dist/esm/audio-waveform-worker.mjs +351 -0
- package/dist/esm/{chunk-hxr6txpe.js → chunk-g39hwn0a.js} +434 -108
- package/dist/esm/internals.mjs +434 -108
- package/dist/esm/previewEntry.mjs +434 -108
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/calculate-timeline.js +16 -0
- package/dist/helpers/extract-frames.js +12 -3
- package/dist/helpers/get-duration-or-compute.d.ts +2 -0
- package/dist/helpers/get-duration-or-compute.js +10 -0
- package/dist/helpers/get-timeline-nestedness.js +2 -1
- package/dist/helpers/use-max-media-duration.js +2 -2
- package/dist/make-audio-waveform-worker.d.ts +1 -0
- package/dist/make-audio-waveform-worker.js +10 -0
- package/package.json +19 -10
package/dist/esm/renderEntry.mjs
CHANGED
|
@@ -209,7 +209,7 @@ var renderContent = (Root) => {
|
|
|
209
209
|
renderToDOM(/* @__PURE__ */ jsx("div", {
|
|
210
210
|
children: /* @__PURE__ */ jsx(DelayedSpinner, {})
|
|
211
211
|
}));
|
|
212
|
-
import("./chunk-
|
|
212
|
+
import("./chunk-g39hwn0a.js").then(({ StudioInternals }) => {
|
|
213
213
|
window.remotion_isStudio = true;
|
|
214
214
|
window.remotion_isReadOnlyStudio = true;
|
|
215
215
|
window.remotion_inputProps = "{}";
|
|
@@ -6,6 +6,19 @@ const get_timeline_nestedness_1 = require("./get-timeline-nestedness");
|
|
|
6
6
|
const get_timeline_sequence_hash_1 = require("./get-timeline-sequence-hash");
|
|
7
7
|
const get_timeline_sequence_sort_key_1 = require("./get-timeline-sequence-sort-key");
|
|
8
8
|
const sort_by_nonce_history_1 = require("./sort-by-nonce-history");
|
|
9
|
+
const getInheritedLoopDisplay = (sequence, sequences) => {
|
|
10
|
+
if (sequence.loopDisplay) {
|
|
11
|
+
return sequence.loopDisplay;
|
|
12
|
+
}
|
|
13
|
+
if (!sequence.parent) {
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
const parent = sequences.find((s) => s.id === sequence.parent);
|
|
17
|
+
if (!parent) {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
return getInheritedLoopDisplay(parent, sequences);
|
|
21
|
+
};
|
|
9
22
|
const calculateTimeline = ({ sequences, }) => {
|
|
10
23
|
const sortedSequences = (0, sort_by_nonce_history_1.sortItemsByNonceHistory)(sequences);
|
|
11
24
|
const tracks = [];
|
|
@@ -33,6 +46,9 @@ const calculateTimeline = ({ sequences, }) => {
|
|
|
33
46
|
...sequence,
|
|
34
47
|
from: visibleStart,
|
|
35
48
|
duration: visibleDuration,
|
|
49
|
+
loopDisplay: sequence.type === 'audio' || sequence.type === 'video'
|
|
50
|
+
? getInheritedLoopDisplay(sequence, sortedSequences)
|
|
51
|
+
: sequence.loopDisplay,
|
|
36
52
|
},
|
|
37
53
|
depth: (0, get_timeline_nestedness_1.getTimelineNestedLevel)(sequence, sortedSequences, 0),
|
|
38
54
|
hash: actualHash,
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.extractFrames = extractFrames;
|
|
4
4
|
const mediabunny_1 = require("mediabunny");
|
|
5
|
+
const get_duration_or_compute_1 = require("./get-duration-or-compute");
|
|
5
6
|
async function extractFrames({ src, timestampsInSeconds, onVideoSample, signal, }) {
|
|
6
7
|
var _a;
|
|
7
8
|
const input = new mediabunny_1.Input({
|
|
@@ -16,18 +17,26 @@ async function extractFrames({ src, timestampsInSeconds, onVideoSample, signal,
|
|
|
16
17
|
}
|
|
17
18
|
try {
|
|
18
19
|
const [durationInSeconds, format, videoTrack] = await Promise.all([
|
|
19
|
-
|
|
20
|
+
(0, get_duration_or_compute_1.getDurationOrCompute)(input),
|
|
20
21
|
input.getFormat(),
|
|
21
22
|
input.getPrimaryVideoTrack(),
|
|
22
23
|
]);
|
|
23
24
|
if (!videoTrack) {
|
|
24
25
|
throw new Error('No video track found in the input');
|
|
25
26
|
}
|
|
27
|
+
if (await videoTrack.isLive()) {
|
|
28
|
+
throw new Error('Live streams are not currently supported by Remotion. Sorry! Source: ' +
|
|
29
|
+
src);
|
|
30
|
+
}
|
|
31
|
+
if (await videoTrack.isRelativeToUnixEpoch()) {
|
|
32
|
+
throw new Error('Streams with UNIX timestamps are not currently supported by Remotion. Sorry! Source: ' +
|
|
33
|
+
src);
|
|
34
|
+
}
|
|
26
35
|
const timestamps = typeof timestampsInSeconds === 'function'
|
|
27
36
|
? await timestampsInSeconds({
|
|
28
37
|
track: {
|
|
29
|
-
width: videoTrack.
|
|
30
|
-
height: videoTrack.
|
|
38
|
+
width: await videoTrack.getDisplayWidth(),
|
|
39
|
+
height: await videoTrack.getDisplayHeight(),
|
|
31
40
|
},
|
|
32
41
|
container: format.name,
|
|
33
42
|
durationInSeconds,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDurationOrCompute = void 0;
|
|
4
|
+
const getDurationOrCompute = async (input) => {
|
|
5
|
+
var _a;
|
|
6
|
+
return ((_a = (await input.getDurationFromMetadata(undefined, {
|
|
7
|
+
skipLiveWait: true,
|
|
8
|
+
}))) !== null && _a !== void 0 ? _a : input.computeDuration(undefined, { skipLiveWait: true }));
|
|
9
|
+
};
|
|
10
|
+
exports.getDurationOrCompute = getDurationOrCompute;
|
|
@@ -9,6 +9,7 @@ const getTimelineNestedLevel = (sequence, allSequences, depth) => {
|
|
|
9
9
|
if (!parentSequence) {
|
|
10
10
|
throw new Error('has parentId but no parent');
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
const parentContributes = parentSequence.showInTimeline;
|
|
13
|
+
return (0, exports.getTimelineNestedLevel)(parentSequence, allSequences, parentContributes ? depth + 1 : depth);
|
|
13
14
|
};
|
|
14
15
|
exports.getTimelineNestedLevel = getTimelineNestedLevel;
|
|
@@ -4,6 +4,7 @@ exports.useMaxMediaDuration = void 0;
|
|
|
4
4
|
const media_utils_1 = require("@remotion/media-utils");
|
|
5
5
|
const mediabunny_1 = require("mediabunny");
|
|
6
6
|
const react_1 = require("react");
|
|
7
|
+
const get_duration_or_compute_1 = require("./get-duration-or-compute");
|
|
7
8
|
const cache = new Map();
|
|
8
9
|
const getSrc = (s) => {
|
|
9
10
|
if (s.type === 'video') {
|
|
@@ -26,8 +27,7 @@ const useMaxMediaDuration = (s, fps) => {
|
|
|
26
27
|
formats: mediabunny_1.ALL_FORMATS,
|
|
27
28
|
source: new mediabunny_1.UrlSource(src),
|
|
28
29
|
});
|
|
29
|
-
input
|
|
30
|
-
.computeDuration()
|
|
30
|
+
(0, get_duration_or_compute_1.getDurationOrCompute)(input)
|
|
31
31
|
.then((duration) => {
|
|
32
32
|
cache.set(src, Math.floor(duration * fps));
|
|
33
33
|
setMaxMediaDuration(Math.floor(duration * fps));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const makeAudioWaveformWorker: () => Worker;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeAudioWaveformWorker = void 0;
|
|
4
|
+
const makeAudioWaveformWorker = () => {
|
|
5
|
+
// @ts-expect-error `import.meta.url` is required for bundling the worker entry.
|
|
6
|
+
return new Worker(new URL('./audio-waveform-worker.mjs', import.meta.url), {
|
|
7
|
+
type: 'module',
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
exports.makeAudioWaveformWorker = makeAudioWaveformWorker;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/studio"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/studio",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.454",
|
|
7
7
|
"description": "APIs for interacting with the Remotion Studio",
|
|
8
8
|
"main": "dist",
|
|
9
9
|
"sideEffects": false,
|
|
@@ -26,14 +26,14 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"semver": "7.5.3",
|
|
29
|
-
"remotion": "4.0.
|
|
30
|
-
"@remotion/player": "4.0.
|
|
31
|
-
"@remotion/media-utils": "4.0.
|
|
32
|
-
"@remotion/renderer": "4.0.
|
|
33
|
-
"@remotion/web-renderer": "4.0.
|
|
34
|
-
"@remotion/studio-shared": "4.0.
|
|
35
|
-
"@remotion/zod-types": "4.0.
|
|
36
|
-
"mediabunny": "1.
|
|
29
|
+
"remotion": "4.0.454",
|
|
30
|
+
"@remotion/player": "4.0.454",
|
|
31
|
+
"@remotion/media-utils": "4.0.454",
|
|
32
|
+
"@remotion/renderer": "4.0.454",
|
|
33
|
+
"@remotion/web-renderer": "4.0.454",
|
|
34
|
+
"@remotion/studio-shared": "4.0.454",
|
|
35
|
+
"@remotion/zod-types": "4.0.454",
|
|
36
|
+
"mediabunny": "1.42.0",
|
|
37
37
|
"memfs": "3.4.3",
|
|
38
38
|
"source-map": "0.7.3",
|
|
39
39
|
"open": "^8.4.2",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"react": "19.2.3",
|
|
44
44
|
"react-dom": "19.2.3",
|
|
45
45
|
"@types/semver": "^7.3.4",
|
|
46
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
46
|
+
"@remotion/eslint-config-internal": "4.0.454",
|
|
47
47
|
"eslint": "9.19.0",
|
|
48
48
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
49
49
|
},
|
|
@@ -75,6 +75,12 @@
|
|
|
75
75
|
"require": "./dist/previewEntry.js",
|
|
76
76
|
"module": "./dist/esm/previewEntry.mjs",
|
|
77
77
|
"import": "./dist/esm/previewEntry.mjs"
|
|
78
|
+
},
|
|
79
|
+
"./audio-waveform-worker": {
|
|
80
|
+
"types": "./dist/audio-waveform-worker.d.ts",
|
|
81
|
+
"require": "./dist/audio-waveform-worker.js",
|
|
82
|
+
"module": "./dist/esm/audio-waveform-worker.mjs",
|
|
83
|
+
"import": "./dist/esm/audio-waveform-worker.mjs"
|
|
78
84
|
}
|
|
79
85
|
},
|
|
80
86
|
"homepage": "https://www.remotion.dev/docs/studio/api",
|
|
@@ -88,6 +94,9 @@
|
|
|
88
94
|
],
|
|
89
95
|
"previewEntry": [
|
|
90
96
|
"./dist/previewEntry.d.ts"
|
|
97
|
+
],
|
|
98
|
+
"audio-waveform-worker": [
|
|
99
|
+
"./dist/audio-waveform-worker.d.ts"
|
|
91
100
|
]
|
|
92
101
|
}
|
|
93
102
|
}
|