@twick/timeline 0.15.7 → 0.15.8
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/index.js +14 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -21
- package/dist/index.mjs.map +1 -1
- package/dist/src/context/timeline-context.d.ts +4 -1
- package/dist/src/context/timeline-context.d.ts.map +1 -1
- package/dist/src/core/editor/timeline.editor.d.ts +10 -10
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -320,15 +320,9 @@ const createAudioTimeline = async (segments, duration) => {
|
|
|
320
320
|
const totalFrames = Math.ceil(duration * sampleRate);
|
|
321
321
|
const offline = new OfflineAudioContextCtor(2, totalFrames, sampleRate);
|
|
322
322
|
for (const segment of segments) {
|
|
323
|
-
if (segment.s >= segment.e)
|
|
324
|
-
console.warn(`Invalid segment: start (${segment.s}) >= end (${segment.e})`);
|
|
325
|
-
continue;
|
|
326
|
-
}
|
|
323
|
+
if (segment.s >= segment.e) continue;
|
|
327
324
|
const volume = segment.volume ?? 1;
|
|
328
|
-
if (volume <= 0)
|
|
329
|
-
console.warn(`Skipping muted segment: ${segment.src}`);
|
|
330
|
-
continue;
|
|
331
|
-
}
|
|
325
|
+
if (volume <= 0) continue;
|
|
332
326
|
try {
|
|
333
327
|
const audioBuffer = await fetchAndDecodeAudio(segment.src);
|
|
334
328
|
const segmentDuration = segment.e - segment.s;
|
|
@@ -344,8 +338,7 @@ const createAudioTimeline = async (segments, duration) => {
|
|
|
344
338
|
source.connect(offline.destination);
|
|
345
339
|
}
|
|
346
340
|
source.start(segment.s, 0, sourceDuration);
|
|
347
|
-
} catch
|
|
348
|
-
console.warn(`Failed to process segment: ${segment.src}`, error);
|
|
341
|
+
} catch {
|
|
349
342
|
}
|
|
350
343
|
}
|
|
351
344
|
return await offline.startRendering();
|
|
@@ -3029,10 +3022,10 @@ class TimelineEditor {
|
|
|
3029
3022
|
}
|
|
3030
3023
|
}
|
|
3031
3024
|
/**
|
|
3032
|
-
* Add an element to a specific track using the visitor pattern
|
|
3033
|
-
* @param track The track to add the element to
|
|
3034
|
-
* @param element The element to add
|
|
3035
|
-
* @returns
|
|
3025
|
+
* Add an element to a specific track using the visitor pattern.
|
|
3026
|
+
* @param track The track to add the element to.
|
|
3027
|
+
* @param element The element to add.
|
|
3028
|
+
* @returns A promise that resolves to `true` if the element was added successfully, otherwise `false`.
|
|
3036
3029
|
*/
|
|
3037
3030
|
async addElementToTrack(track, element) {
|
|
3038
3031
|
var _a;
|
|
@@ -3060,9 +3053,9 @@ class TimelineEditor {
|
|
|
3060
3053
|
}
|
|
3061
3054
|
}
|
|
3062
3055
|
/**
|
|
3063
|
-
* Remove an element from a specific track using the visitor pattern
|
|
3064
|
-
* @param element The element to remove
|
|
3065
|
-
* @returns
|
|
3056
|
+
* Remove an element from a specific track using the visitor pattern.
|
|
3057
|
+
* @param element The element to remove.
|
|
3058
|
+
* @returns `true` if the element was removed successfully, otherwise `false`.
|
|
3066
3059
|
*/
|
|
3067
3060
|
removeElement(element) {
|
|
3068
3061
|
const track = this.getTrackById(element.getTrackId());
|
|
@@ -3084,9 +3077,9 @@ class TimelineEditor {
|
|
|
3084
3077
|
}
|
|
3085
3078
|
}
|
|
3086
3079
|
/**
|
|
3087
|
-
* Update an element in a specific track using the visitor pattern
|
|
3088
|
-
* @param element The updated element
|
|
3089
|
-
* @returns
|
|
3080
|
+
* Update an element in a specific track using the visitor pattern.
|
|
3081
|
+
* @param element The updated element.
|
|
3082
|
+
* @returns The updated `TrackElement`.
|
|
3090
3083
|
*/
|
|
3091
3084
|
updateElement(element) {
|
|
3092
3085
|
const track = this.getTrackById(element.getTrackId());
|
|
@@ -8138,7 +8131,7 @@ var __POSTHOG_ERROR_MESSAGES = {
|
|
|
8138
8131
|
return PostHogErrorBoundary;
|
|
8139
8132
|
})(React.Component);
|
|
8140
8133
|
const name = "@twick/timeline";
|
|
8141
|
-
const version = "0.15.
|
|
8134
|
+
const version = "0.15.8";
|
|
8142
8135
|
const packageJson = {
|
|
8143
8136
|
name,
|
|
8144
8137
|
version
|