I believe the update function is a bit problematic because the if conditions will prevent updates in case we wish to set certain values to undefined or to 0.
Let's say we have a blur filter on and with the radius of 10 and now we wish to turn it off and set the background image instead. Now setting it to undefined or 0 will not enter the if condition as in both cases that evaluates to false. The same goes for the image.
So I guess the update function might need to be expanded to account for the time the user wishes to reset these values/disable certain things.
Or is the best practice approach here to stop the previous processor and create a new one?
https://github.com/livekit/track-processors-js/blob/964dd5911ef38ef346f7d5e857d51565d03f0979/src/transformers/BackgroundTransformer.ts#L111
I believe the update function is a bit problematic because the if conditions will prevent updates in case we wish to set certain values to undefined or to 0. Let's say we have a blur filter on and with the radius of 10 and now we wish to turn it off and set the background image instead. Now setting it to undefined or 0 will not enter the if condition as in both cases that evaluates to false. The same goes for the image.
So I guess the update function might need to be expanded to account for the time the user wishes to reset these values/disable certain things.
Or is the best practice approach here to stop the previous processor and create a new one?