@remotion/timeline-utils 4.0.515 → 4.0.517
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/esm/index.mjs +0 -69
- package/dist/index.d.ts +0 -2
- package/dist/index.js +1 -5
- package/package.json +3 -3
package/dist/esm/index.mjs
CHANGED
|
@@ -747,73 +747,6 @@ var addFrameToCache = (key, frame) => {
|
|
|
747
747
|
});
|
|
748
748
|
evictLRU();
|
|
749
749
|
};
|
|
750
|
-
// src/image-thumbnail/get-scaled-image-thumbnail-dimensions.ts
|
|
751
|
-
var getScaledImageThumbnailDimensions = ({
|
|
752
|
-
naturalWidth,
|
|
753
|
-
naturalHeight,
|
|
754
|
-
canvasHeight
|
|
755
|
-
}) => {
|
|
756
|
-
if (naturalWidth === 0 || naturalHeight === 0 || canvasHeight === 0) {
|
|
757
|
-
return {
|
|
758
|
-
scaledWidth: 0,
|
|
759
|
-
scaledHeight: 0
|
|
760
|
-
};
|
|
761
|
-
}
|
|
762
|
-
const scale = canvasHeight / naturalHeight;
|
|
763
|
-
return {
|
|
764
|
-
scaledWidth: naturalWidth * scale,
|
|
765
|
-
scaledHeight: canvasHeight
|
|
766
|
-
};
|
|
767
|
-
};
|
|
768
|
-
|
|
769
|
-
// src/image-thumbnail/draw-repeating-image-thumbnail.ts
|
|
770
|
-
var createOffscreenCanvas = (width, height) => {
|
|
771
|
-
if (typeof document !== "undefined") {
|
|
772
|
-
const canvas = document.createElement("canvas");
|
|
773
|
-
canvas.width = width;
|
|
774
|
-
canvas.height = height;
|
|
775
|
-
return canvas;
|
|
776
|
-
}
|
|
777
|
-
if (typeof OffscreenCanvas !== "undefined") {
|
|
778
|
-
return new OffscreenCanvas(width, height);
|
|
779
|
-
}
|
|
780
|
-
throw new Error("No canvas implementation available");
|
|
781
|
-
};
|
|
782
|
-
var drawRepeatingImageThumbnail = ({
|
|
783
|
-
canvas,
|
|
784
|
-
image,
|
|
785
|
-
offsetInPixels = 0
|
|
786
|
-
}) => {
|
|
787
|
-
const ctx = canvas.getContext("2d");
|
|
788
|
-
if (!ctx) {
|
|
789
|
-
throw new Error("Failed to get canvas context");
|
|
790
|
-
}
|
|
791
|
-
const { width, height } = canvas;
|
|
792
|
-
if (width === 0 || height === 0) {
|
|
793
|
-
return;
|
|
794
|
-
}
|
|
795
|
-
const { scaledWidth, scaledHeight } = getScaledImageThumbnailDimensions({
|
|
796
|
-
naturalWidth: image.naturalWidth,
|
|
797
|
-
naturalHeight: image.naturalHeight,
|
|
798
|
-
canvasHeight: height
|
|
799
|
-
});
|
|
800
|
-
if (scaledWidth === 0 || scaledHeight === 0) {
|
|
801
|
-
return;
|
|
802
|
-
}
|
|
803
|
-
const offscreen = createOffscreenCanvas(scaledWidth, scaledHeight);
|
|
804
|
-
const offCtx = offscreen.getContext("2d");
|
|
805
|
-
if (!offCtx) {
|
|
806
|
-
throw new Error("Failed to get offscreen canvas context");
|
|
807
|
-
}
|
|
808
|
-
offCtx.drawImage(image, 0, 0, scaledWidth, scaledHeight);
|
|
809
|
-
const pattern = ctx.createPattern(offscreen, "repeat-x");
|
|
810
|
-
if (!pattern) {
|
|
811
|
-
return;
|
|
812
|
-
}
|
|
813
|
-
pattern.setTransform(new DOMMatrix().translate(-offsetInPixels, 0));
|
|
814
|
-
ctx.fillStyle = pattern;
|
|
815
|
-
ctx.fillRect(0, 0, width, height);
|
|
816
|
-
};
|
|
817
750
|
// src/render-frame-strip.ts
|
|
818
751
|
var WEBCODECS_TIMESCALE = 1e6;
|
|
819
752
|
var MAX_TIME_DEVIATION = WEBCODECS_TIMESCALE * 0.05;
|
|
@@ -1162,7 +1095,6 @@ export {
|
|
|
1162
1095
|
loadWaveformPeaks,
|
|
1163
1096
|
getVisibleWaveformVolume,
|
|
1164
1097
|
getTimestampFromFrameDatabaseKey,
|
|
1165
|
-
getScaledImageThumbnailDimensions,
|
|
1166
1098
|
getLoopDisplayWidth,
|
|
1167
1099
|
getLoopDisplaySegments,
|
|
1168
1100
|
getFrameDatabaseKeyPrefix,
|
|
@@ -1175,7 +1107,6 @@ export {
|
|
|
1175
1107
|
ensureSlots,
|
|
1176
1108
|
emitWaveformProgress,
|
|
1177
1109
|
drawSlot,
|
|
1178
|
-
drawRepeatingImageThumbnail,
|
|
1179
1110
|
drawBars,
|
|
1180
1111
|
createWaveformPeakProcessor,
|
|
1181
1112
|
clampTimestampsToDuration,
|
package/dist/index.d.ts
CHANGED
|
@@ -12,8 +12,6 @@ export { extractFrames } from './extract-frames';
|
|
|
12
12
|
export type { ExtractFramesProps, ExtractFramesTimestampsInSecondsFn, } from './extract-frames';
|
|
13
13
|
export { addFrameToCache, aspectRatioCache, frameDatabase, getAspectRatioFromCache, getFrameDatabaseKeyPrefix, getTimestampFromFrameDatabaseKey, makeFrameDatabaseKey, } from './frame-database';
|
|
14
14
|
export type { FrameDatabaseKey } from './frame-database';
|
|
15
|
-
export { drawRepeatingImageThumbnail } from './image-thumbnail/draw-repeating-image-thumbnail';
|
|
16
|
-
export { getScaledImageThumbnailDimensions } from './image-thumbnail/get-scaled-image-thumbnail-dimensions';
|
|
17
15
|
export { getLoopDisplaySegments, getLoopDisplayWidth, shouldTileLoopDisplay, } from './loop-display';
|
|
18
16
|
export type { LoopDisplaySegment, TimelineLoopDisplay } from './loop-display';
|
|
19
17
|
export { WEBCODECS_TIMESCALE, calculateTimestampSlots, drawSlot, ensureSlots, fillFrameWhereItFits, fillWithCachedFrames, getDurationOfOneFrame, } from './render-frame-strip';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resizeVideoFrame = exports.renderFrameStripToCanvas = exports.getDurationOfOneFrame = exports.fillWithCachedFrames = exports.fillFrameWhereItFits = exports.ensureSlots = exports.drawSlot = exports.calculateTimestampSlots = exports.WEBCODECS_TIMESCALE = exports.shouldTileLoopDisplay = exports.getLoopDisplayWidth = exports.getLoopDisplaySegments = exports.
|
|
3
|
+
exports.resizeVideoFrame = exports.renderFrameStripToCanvas = exports.getDurationOfOneFrame = exports.fillWithCachedFrames = exports.fillFrameWhereItFits = exports.ensureSlots = exports.drawSlot = exports.calculateTimestampSlots = exports.WEBCODECS_TIMESCALE = exports.shouldTileLoopDisplay = exports.getLoopDisplayWidth = exports.getLoopDisplaySegments = exports.makeFrameDatabaseKey = exports.getTimestampFromFrameDatabaseKey = exports.getFrameDatabaseKeyPrefix = exports.getAspectRatioFromCache = exports.frameDatabase = exports.aspectRatioCache = exports.addFrameToCache = exports.extractFrames = exports.clampTimestampsToDuration = exports.emitWaveformProgress = exports.createWaveformPeakProcessor = exports.sliceWaveformPeaks = exports.subscribeToWaveformPeaks = exports.sliceVisibleWaveformPeaks = exports.loadWaveformPeaks = exports.getVisibleWaveformVolume = exports.drawBars = exports.TARGET_SAMPLE_RATE = void 0;
|
|
4
4
|
const constants_1 = require("./audio-waveform/constants");
|
|
5
5
|
Object.defineProperty(exports, "TARGET_SAMPLE_RATE", { enumerable: true, get: function () { return constants_1.TARGET_SAMPLE_RATE; } });
|
|
6
6
|
const draw_peaks_1 = require("./audio-waveform/draw-peaks");
|
|
@@ -30,10 +30,6 @@ Object.defineProperty(exports, "getAspectRatioFromCache", { enumerable: true, ge
|
|
|
30
30
|
Object.defineProperty(exports, "getFrameDatabaseKeyPrefix", { enumerable: true, get: function () { return frame_database_1.getFrameDatabaseKeyPrefix; } });
|
|
31
31
|
Object.defineProperty(exports, "getTimestampFromFrameDatabaseKey", { enumerable: true, get: function () { return frame_database_1.getTimestampFromFrameDatabaseKey; } });
|
|
32
32
|
Object.defineProperty(exports, "makeFrameDatabaseKey", { enumerable: true, get: function () { return frame_database_1.makeFrameDatabaseKey; } });
|
|
33
|
-
const draw_repeating_image_thumbnail_1 = require("./image-thumbnail/draw-repeating-image-thumbnail");
|
|
34
|
-
Object.defineProperty(exports, "drawRepeatingImageThumbnail", { enumerable: true, get: function () { return draw_repeating_image_thumbnail_1.drawRepeatingImageThumbnail; } });
|
|
35
|
-
const get_scaled_image_thumbnail_dimensions_1 = require("./image-thumbnail/get-scaled-image-thumbnail-dimensions");
|
|
36
|
-
Object.defineProperty(exports, "getScaledImageThumbnailDimensions", { enumerable: true, get: function () { return get_scaled_image_thumbnail_dimensions_1.getScaledImageThumbnailDimensions; } });
|
|
37
33
|
const loop_display_1 = require("./loop-display");
|
|
38
34
|
Object.defineProperty(exports, "getLoopDisplaySegments", { enumerable: true, get: function () { return loop_display_1.getLoopDisplaySegments; } });
|
|
39
35
|
Object.defineProperty(exports, "getLoopDisplayWidth", { enumerable: true, get: function () { return loop_display_1.getLoopDisplayWidth; } });
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/timeline-utils"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/timeline-utils",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.517",
|
|
7
7
|
"description": "Internal utilities for rendering Remotion timelines",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"scripts": {
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"mediabunny": "1.55.1",
|
|
25
|
-
"remotion": "4.0.
|
|
25
|
+
"remotion": "4.0.517"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@mediabunny/server": "1.55.1",
|
|
29
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
29
|
+
"@remotion/eslint-config-internal": "4.0.517",
|
|
30
30
|
"eslint": "9.19.0",
|
|
31
31
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
32
32
|
},
|