@agrhub/engine-pixi 1.4.2 → 1.4.3

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.es.js CHANGED
@@ -12490,7 +12490,7 @@ class Va {
12490
12490
  const i = e.path.split("/").filter(Boolean);
12491
12491
  if (i[0] === "clips") {
12492
12492
  const s = i[1];
12493
- e.op === "add" && !i[2] ? await this.handleAddClip(e.value) : e.op === "remove" && !i[2] ? await this.handleRemoveClip(s) : e.op === "update" && await this.handleUpdateClip(s, i.slice(2), e.value);
12493
+ e.op === "add" && !i[2] ? await this.addClipSafely(e.value) : e.op === "remove" && !i[2] ? await this.handleRemoveClip(s) : e.op === "update" && await this.handleUpdateClip(s, i.slice(2), e.value);
12494
12494
  }
12495
12495
  if (i[0] === "tracks" && await this.studio.setTracks(this.core.store.getState().tracks), i[0] === "settings") {
12496
12496
  const s = this.core.store.getState().settings;
@@ -12507,6 +12507,17 @@ class Va {
12507
12507
  const e = this.getTrackCaptionConfig(t.id);
12508
12508
  return e ? { captionConfig: e } : void 0;
12509
12509
  }
12510
+ /**
12511
+ * One clip that cannot load (unreachable or non-media src) must not abort the rest: the rebuild used to
12512
+ * stop at the first failing clip, leaving the canvas empty/black for every clip after it.
12513
+ */
12514
+ async addClipSafely(t) {
12515
+ try {
12516
+ await this.handleAddClip(t);
12517
+ } catch (e) {
12518
+ console.warn(`[StudioBridge] Skipped clip ${t?.id} (${t?.type}): could not load`, e);
12519
+ }
12520
+ }
12510
12521
  async handleAddClip(t) {
12511
12522
  if (t.type === "Transition")
12512
12523
  await this.studio.addTransition(
@@ -12567,7 +12578,7 @@ class Va {
12567
12578
  const t = this.core.store.getState();
12568
12579
  this.studio.setSize(t.settings.width, t.settings.height);
12569
12580
  for (const e in t.clips)
12570
- await this.handleAddClip(t.clips[e]);
12581
+ await this.addClipSafely(t.clips[e]);
12571
12582
  this.studio.setTracks(t.tracks), this.syncSelectionToStudio(t.selectedIds), this.studio.updateFrame(t.currentTime);
12572
12583
  } finally {
12573
12584
  this.isSyncing = !1;