@tradalab/mediakit 2.9.0 → 2.9.1

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/worker.js CHANGED
@@ -5512,7 +5512,7 @@
5512
5512
  // steers on past numbers because there is no way to know in advance what a frame will cost.
5513
5513
  prevTotalMs = 0;
5514
5514
  prevSegMs = 0;
5515
- last = { ...ZERO_STATS };
5515
+ last = { ...ZERO_STATS, parts: { ...NO_PARTS }, partErrors: { ...NO_PART_ERRORS } };
5516
5516
  constructor(canvas, gl, core) {
5517
5517
  this.canvas = canvas;
5518
5518
  this.gl = gl;
@@ -5730,7 +5730,7 @@
5730
5730
  });
5731
5731
  }).catch((e2) => {
5732
5732
  this.failed.add("face");
5733
- this.partFailed("face", "face detection", "face effects", e2);
5733
+ this.partFailed("face", "face detection", "face effects stay off", e2);
5734
5734
  this.gaveUp("face effects", e2);
5735
5735
  if (!(e2 instanceof LoadTimeout)) console.error("mediakit: face detector failed to load", e2);
5736
5736
  }).finally(() => {
@@ -5749,7 +5749,7 @@
5749
5749
  }).catch((e2) => {
5750
5750
  if (!(e2 instanceof LoadTimeout)) return;
5751
5751
  this.failed.add("person");
5752
- this.partFailed("person", "person segmentation", "background effects", e2);
5752
+ this.partFailed("person", "person segmentation", "background effects stay off", e2);
5753
5753
  this.gaveUp("background effects", e2);
5754
5754
  }).finally(() => {
5755
5755
  this.personLoading = null;
@@ -5810,7 +5810,7 @@
5810
5810
  cover: (ok, message) => {
5811
5811
  if (key !== "face" || this.coverState === "failed") return;
5812
5812
  this.coverState = ok ? "ready" : "failed";
5813
- if (!ok) this.partErr.set("cover", `mediakit: ${message}; occluders stays off`);
5813
+ if (!ok) this.partErr.set("cover", `${message}; occluders stays off`);
5814
5814
  },
5815
5815
  failed: (k2, reason) => {
5816
5816
  if (key === "faceExtra") {
@@ -6114,7 +6114,7 @@
6114
6114
  this.segmenter = s2;
6115
6115
  }).catch((e2) => {
6116
6116
  this.failed.add("segmenter");
6117
- this.partFailed("person", "person segmentation", "background and skin effects", e2);
6117
+ this.partFailed("person", "person segmentation", "background and skin effects stay off", e2);
6118
6118
  this.gaveUp("background and skin effects", e2);
6119
6119
  if (!(e2 instanceof LoadTimeout)) console.error("mediakit: segmenter failed to load", e2);
6120
6120
  }).finally(() => {
@@ -6478,10 +6478,10 @@
6478
6478
  };
6479
6479
  return glCalls > 0;
6480
6480
  }
6481
- partFailed(part, what, off, e2) {
6481
+ partFailed(part, what, then, e2) {
6482
6482
  if (this.partErr.has(part)) return;
6483
6483
  const why = e2 instanceof LoadTimeout ? e2.message : `mediakit: ${what} did not load: ${String(e2?.message ?? e2)}`;
6484
- this.partErr.set(part, `${why}; ${off} stay off`);
6484
+ this.partErr.set(part, `${why}; ${then}`);
6485
6485
  }
6486
6486
  parts() {
6487
6487
  const f2 = this.filter;