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