@remotion/studio 4.0.372 → 4.0.374

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.
@@ -1,13 +1,18 @@
1
1
  "use strict";
2
2
  // Cache the thumbnails of the timeline
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.clearOldFrames = exports.getAspectRatioFromCache = exports.getTimestampFromFrameDatabaseKey = exports.aspectRatioCache = exports.frameDatabase = exports.makeFrameDatabaseKey = void 0;
5
- const makeFrameDatabaseKey = (src, timestamp) => `${src}|${timestamp}`;
4
+ exports.clearFramesForSrc = exports.clearOldFrames = exports.getAspectRatioFromCache = exports.getTimestampFromFrameDatabaseKey = exports.aspectRatioCache = exports.frameDatabase = exports.getFrameDatabaseKeyPrefix = exports.makeFrameDatabaseKey = void 0;
5
+ const KEY_SEPARATOR = '|';
6
+ const makeFrameDatabaseKey = (src, timestamp) => `${src}${KEY_SEPARATOR}${timestamp}`;
6
7
  exports.makeFrameDatabaseKey = makeFrameDatabaseKey;
8
+ const getFrameDatabaseKeyPrefix = (src) => {
9
+ return `${src}${KEY_SEPARATOR}`;
10
+ };
11
+ exports.getFrameDatabaseKeyPrefix = getFrameDatabaseKeyPrefix;
7
12
  exports.frameDatabase = new Map();
8
13
  exports.aspectRatioCache = new Map();
9
14
  const getTimestampFromFrameDatabaseKey = (key) => {
10
- const split = key.split('|');
15
+ const split = key.split(KEY_SEPARATOR);
11
16
  return Number(split[split.length - 1]);
12
17
  };
13
18
  exports.getTimestampFromFrameDatabaseKey = getTimestampFromFrameDatabaseKey;
@@ -33,3 +38,17 @@ const clearOldFrames = () => {
33
38
  }
34
39
  };
35
40
  exports.clearOldFrames = clearOldFrames;
41
+ const clearFramesForSrc = (src) => {
42
+ const keysToRemove = [];
43
+ const prefix = (0, exports.getFrameDatabaseKeyPrefix)(src);
44
+ for (const [key, frame] of exports.frameDatabase.entries()) {
45
+ if (key.startsWith(prefix)) {
46
+ frame.frame.close();
47
+ keysToRemove.push(key);
48
+ }
49
+ }
50
+ for (const key of keysToRemove) {
51
+ exports.frameDatabase.delete(key);
52
+ }
53
+ };
54
+ exports.clearFramesForSrc = clearFramesForSrc;
@@ -174,7 +174,7 @@ const renderContent = (Root) => {
174
174
  var _a, _b;
175
175
  const bundleMode = getBundleMode();
176
176
  if (bundleMode.type === 'composition') {
177
- const markup = ((0, jsx_runtime_1.jsxs)(remotion_1.Internals.RemotionRoot, { audioEnabled: window.remotion_audioEnabled, videoEnabled: window.remotion_videoEnabled, logLevel: window.remotion_logLevel, numberOfAudioTags: 0, audioLatencyHint: (_a = window.remotion_audioLatencyHint) !== null && _a !== void 0 ? _a : 'interactive', onlyRenderComposition: bundleMode.compositionName, currentCompositionMetadata: {
177
+ const markup = ((0, jsx_runtime_1.jsx)(remotion_1.Internals.CompositionManagerProvider, { initialCanvasContent: null, onlyRenderComposition: bundleMode.compositionName, currentCompositionMetadata: {
178
178
  props: no_react_1.NoReactInternals.deserializeJSONWithSpecialTypes(bundleMode.serializedResolvedPropsWithSchema),
179
179
  durationInFrames: bundleMode.compositionDurationInFrames,
180
180
  fps: bundleMode.compositionFps,
@@ -185,11 +185,11 @@ const renderContent = (Root) => {
185
185
  defaultVideoImageFormat: bundleMode.compositionDefaultVideoImageFormat,
186
186
  defaultPixelFormat: bundleMode.compositionDefaultPixelFormat,
187
187
  defaultProResProfile: bundleMode.compositionDefaultProResProfile,
188
- }, children: [(0, jsx_runtime_1.jsx)(Root, {}), (0, jsx_runtime_1.jsx)(GetVideoComposition, { state: bundleMode })] }));
188
+ }, initialCompositions: [], children: (0, jsx_runtime_1.jsxs)(remotion_1.Internals.RemotionRoot, { frameState: null, audioEnabled: window.remotion_audioEnabled, videoEnabled: window.remotion_videoEnabled, logLevel: window.remotion_logLevel, numberOfAudioTags: 0, audioLatencyHint: (_a = window.remotion_audioLatencyHint) !== null && _a !== void 0 ? _a : 'interactive', children: [(0, jsx_runtime_1.jsx)(Root, {}), (0, jsx_runtime_1.jsx)(GetVideoComposition, { state: bundleMode })] }) }));
189
189
  renderToDOM(markup);
190
190
  }
191
191
  if (bundleMode.type === 'evaluation') {
192
- const markup = ((0, jsx_runtime_1.jsx)(remotion_1.Internals.RemotionRoot, { audioEnabled: window.remotion_audioEnabled, videoEnabled: window.remotion_videoEnabled, logLevel: window.remotion_logLevel, numberOfAudioTags: 0, onlyRenderComposition: null, currentCompositionMetadata: null, audioLatencyHint: (_b = window.remotion_audioLatencyHint) !== null && _b !== void 0 ? _b : 'interactive', children: (0, jsx_runtime_1.jsx)(Root, {}) }));
192
+ const markup = ((0, jsx_runtime_1.jsx)(remotion_1.Internals.CompositionManagerProvider, { initialCanvasContent: null, onlyRenderComposition: null, currentCompositionMetadata: null, initialCompositions: [], children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.RemotionRoot, { frameState: null, audioEnabled: window.remotion_audioEnabled, videoEnabled: window.remotion_videoEnabled, logLevel: window.remotion_logLevel, numberOfAudioTags: 0, audioLatencyHint: (_b = window.remotion_audioLatencyHint) !== null && _b !== void 0 ? _b : 'interactive', children: (0, jsx_runtime_1.jsx)(Root, {}) }) }));
193
193
  renderToDOM(markup);
194
194
  }
195
195
  if (bundleMode.type === 'index') {
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.372",
6
+ "version": "4.0.374",
7
7
  "description": "APIs for interacting with the Remotion Studio",
8
8
  "main": "dist",
9
9
  "sideEffects": false,
@@ -25,13 +25,13 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "semver": "7.5.3",
28
- "remotion": "4.0.372",
29
- "@remotion/player": "4.0.372",
30
- "@remotion/media-utils": "4.0.372",
31
- "@remotion/renderer": "4.0.372",
32
- "@remotion/web-renderer": "4.0.372",
33
- "@remotion/studio-shared": "4.0.372",
34
- "@remotion/zod-types": "4.0.372",
28
+ "remotion": "4.0.374",
29
+ "@remotion/player": "4.0.374",
30
+ "@remotion/media-utils": "4.0.374",
31
+ "@remotion/renderer": "4.0.374",
32
+ "@remotion/web-renderer": "4.0.374",
33
+ "@remotion/studio-shared": "4.0.374",
34
+ "@remotion/zod-types": "4.0.374",
35
35
  "mediabunny": "1.24.3",
36
36
  "memfs": "3.4.3",
37
37
  "source-map": "0.7.3",
@@ -42,7 +42,7 @@
42
42
  "react": "19.0.0",
43
43
  "react-dom": "19.0.0",
44
44
  "@types/semver": "^7.3.4",
45
- "@remotion/eslint-config-internal": "4.0.372",
45
+ "@remotion/eslint-config-internal": "4.0.374",
46
46
  "eslint": "9.19.0"
47
47
  },
48
48
  "publishConfig": {
@@ -1 +0,0 @@
1
- export declare const canDecode: (src: string) => Promise<boolean>;
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.canDecode = void 0;
4
- const mediabunny_1 = require("mediabunny");
5
- const canDecode = async (src) => {
6
- const input = new mediabunny_1.Input({
7
- formats: mediabunny_1.ALL_FORMATS,
8
- source: new mediabunny_1.UrlSource(src),
9
- });
10
- const videoTrack = await input.getPrimaryVideoTrack();
11
- if (videoTrack) {
12
- if (!(await videoTrack.canDecode())) {
13
- return false;
14
- }
15
- }
16
- const audioTrack = await input.getPrimaryAudioTrack();
17
- if (audioTrack) {
18
- if (!(await audioTrack.canDecode())) {
19
- return false;
20
- }
21
- }
22
- return true;
23
- };
24
- exports.canDecode = canDecode;
@@ -1,25 +0,0 @@
1
- var __create = Object.create;
2
- var __getProtoOf = Object.getPrototypeOf;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __toESM = (mod, isNodeMode, target) => {
7
- target = mod != null ? __create(__getProtoOf(mod)) : {};
8
- const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
9
- for (let key of __getOwnPropNames(mod))
10
- if (!__hasOwnProp.call(to, key))
11
- __defProp(to, key, {
12
- get: () => mod[key],
13
- enumerable: true
14
- });
15
- return to;
16
- };
17
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
18
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
19
- }) : x)(function(x) {
20
- if (typeof require !== "undefined")
21
- return require.apply(this, arguments);
22
- throw Error('Dynamic require of "' + x + '" is not supported');
23
- });
24
-
25
- export { __toESM, __require };