diff --git a/.changeset/mighty-pandas-change.md b/.changeset/mighty-pandas-change.md new file mode 100644 index 0000000..e48d00c --- /dev/null +++ b/.changeset/mighty-pandas-change.md @@ -0,0 +1,5 @@ +--- +"@livekit/track-processors": patch +--- + +Reload the background image when needed during processor initialization diff --git a/src/transformers/BackgroundTransformer.ts b/src/transformers/BackgroundTransformer.ts index 9c610e9..52e7024 100644 --- a/src/transformers/BackgroundTransformer.ts +++ b/src/transformers/BackgroundTransformer.ts @@ -56,7 +56,10 @@ export default class BackgroundProcessor extends VideoTransformer 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() {