Skip to content

Commit

Permalink
Reload the background image when needed during processor initializati…
Browse files Browse the repository at this point in the history
…on (#42)

Co-authored-by: lukasIO <[email protected]>
  • Loading branch information
kyleparrott and lukasIO authored May 30, 2024
1 parent cbca853 commit 753bd5b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/mighty-pandas-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@livekit/track-processors": patch
---

Reload the background image when needed during processor initialization
5 changes: 4 additions & 1 deletion src/transformers/BackgroundTransformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ export default class BackgroundProcessor extends VideoTransformer<BackgroundOpti
outputConfidenceMasks: false,
});

// this.loadBackground(opts.backgroundUrl).catch((e) => console.error(e));
// Skip loading the image here if update already loaded the image below
if (this.options?.imagePath && !this.backgroundImage) {
await this.loadBackground(this.options.imagePath).catch((err) => console.error("Error while loading processor background image: ", err));
}
}

async destroy() {
Expand Down

0 comments on commit 753bd5b

Please sign in to comment.