@vonage/ml-transformers 2.0.3 → 2.0.4

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.
@@ -22575,6 +22575,7 @@ class VonageMediaProcessorWorker extends emittery {
22575
22575
  if (msg2.message === "pipeline_ended" || msg2.message === "pipeline_ended_with_error") {
22576
22576
  this.mediapipeHelper_.close().finally(() => {
22577
22577
  if (this.worker_) {
22578
+ this.cleanInnerEmitty();
22578
22579
  this.worker_.terminate();
22579
22580
  this.workerInited_ = false;
22580
22581
  this.worker_ = void 0;
@@ -22585,6 +22586,27 @@ class VonageMediaProcessorWorker extends emittery {
22585
22586
  }
22586
22587
  });
22587
22588
  }
22589
+ cleanInnerEmitty() {
22590
+ let error = "Worker ended";
22591
+ if (this.innerEmitty_.listenerCount("initResults")) {
22592
+ this.innerEmitty_.emit("initResults", JSON.stringify({ error }));
22593
+ }
22594
+ if (this.innerEmitty_.listenerCount("destroyResults")) {
22595
+ this.innerEmitty_.emit("destroyResults", JSON.stringify({ error }));
22596
+ }
22597
+ if (this.innerEmitty_.listenerCount("setBackgroundOptionsResults")) {
22598
+ this.innerEmitty_.emit("setBackgroundOptionsResults", JSON.stringify({ error }));
22599
+ }
22600
+ if (this.innerEmitty_.listenerCount("setVideoBGReadableResults")) {
22601
+ this.innerEmitty_.emit("setVideoBGReadableResults", JSON.stringify({ error }));
22602
+ }
22603
+ if (this.innerEmitty_.listenerCount("setVirtualBGImageResults")) {
22604
+ this.innerEmitty_.emit("setVirtualBGImageResults", JSON.stringify({ error }));
22605
+ }
22606
+ if (this.innerEmitty_.listenerCount("transformResults")) {
22607
+ this.innerEmitty_.emit("transformResults", JSON.stringify({ error }));
22608
+ }
22609
+ }
22588
22610
  init(config) {
22589
22611
  return new Promise((resolve, reject) => {
22590
22612
  if (!this.worker_) {