@viji-dev/core 0.3.28 → 0.3.30

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.
@@ -590,7 +590,7 @@ class IFrameManager {
590
590
  }
591
591
  function WorkerWrapper(options) {
592
592
  return new Worker(
593
- "" + new URL("assets/viji.worker-CdHkRwxI.js", import.meta.url).href,
593
+ "" + new URL("assets/viji.worker-CQSJ0SiO.js", import.meta.url).href,
594
594
  {
595
595
  type: "module",
596
596
  name: options?.name
@@ -598,10 +598,12 @@ function WorkerWrapper(options) {
598
598
  );
599
599
  }
600
600
  class WorkerManager {
601
- constructor(sceneCode, offscreenCanvas, isHeadless = false) {
601
+ constructor(sceneCode, offscreenCanvas, isHeadless = false, initialSC, initialRH) {
602
602
  this.sceneCode = sceneCode;
603
603
  this.offscreenCanvas = offscreenCanvas;
604
604
  this.isHeadless = isHeadless;
605
+ this.initialSC = initialSC;
606
+ this.initialRH = initialRH;
605
607
  }
606
608
  worker = null;
607
609
  messageId = 0;
@@ -769,7 +771,9 @@ class WorkerManager {
769
771
  timestamp: Date.now(),
770
772
  data: {
771
773
  canvas: this.offscreenCanvas,
772
- isHeadless: this.isHeadless
774
+ isHeadless: this.isHeadless,
775
+ sc: this.initialSC,
776
+ rh: this.initialRH
773
777
  }
774
778
  };
775
779
  return new Promise((resolve, reject) => {
@@ -1746,7 +1750,7 @@ class EssentiaOnsetDetection {
1746
1750
  this.initPromise = (async () => {
1747
1751
  try {
1748
1752
  const essentiaModule = await import("./essentia.js-core.es-DnrJE0uR.js");
1749
- const wasmModule = await import("./essentia-wasm.web-CJ3YX7ue.js").then((n) => n.e);
1753
+ const wasmModule = await import("./essentia-wasm.web-0S-sW98u.js").then((n) => n.e);
1750
1754
  const EssentiaClass = essentiaModule.Essentia || essentiaModule.default?.Essentia || essentiaModule.default;
1751
1755
  let WASMModule = wasmModule.default || wasmModule.EssentiaWASM || wasmModule.default?.EssentiaWASM;
1752
1756
  if (!WASMModule) {
@@ -14861,12 +14865,16 @@ class VijiCore {
14861
14865
  this.workerManager = new WorkerManager(
14862
14866
  this.config.sceneCode,
14863
14867
  offscreenCanvas,
14864
- this.isHeadless
14868
+ this.isHeadless,
14869
+ this.config._sc,
14870
+ this.config._rh
14865
14871
  );
14866
14872
  this.setupCommunication();
14867
14873
  await this.workerManager.createWorker();
14868
- if (this.config._sc) {
14869
- this.workerManager.postMessage("sc-update", { t: this.config._sc });
14874
+ try {
14875
+ this.config.onRenderStart?.();
14876
+ } catch (e) {
14877
+ console.warn("[Viji] onRenderStart callback error:", e);
14870
14878
  }
14871
14879
  this.audioSystem = new AudioSystem((message) => {
14872
14880
  if (this.workerManager) {
@@ -16423,7 +16431,7 @@ class VijiCore {
16423
16431
  }
16424
16432
  }
16425
16433
  }
16426
- const VERSION = "0.2.20";
16434
+ const VERSION = "0.3.29";
16427
16435
  export {
16428
16436
  AudioSystem as A,
16429
16437
  VERSION as V,
@@ -16431,4 +16439,4 @@ export {
16431
16439
  VijiCoreError as b,
16432
16440
  getDefaultExportFromCjs as g
16433
16441
  };
16434
- //# sourceMappingURL=index-i7P2rHW8.js.map
16442
+ //# sourceMappingURL=index-vsUdXe52.js.map