♻️(front) add clone method to processors
We need to make new processor instance between pre join and room in order to apply effects.
This commit is contained in:
@@ -278,4 +278,8 @@ export class BackgroundBlurCustomProcessor
|
|||||||
this.timerWorker?.terminate()
|
this.timerWorker?.terminate()
|
||||||
this.imageSegmenter?.close()
|
this.imageSegmenter?.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clone() {
|
||||||
|
return new BackgroundBlurCustomProcessor(this.options)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,8 +18,11 @@ export class BackgroundBlurTrackProcessorJsWrapper
|
|||||||
|
|
||||||
processor: ProcessorWrapper<BackgroundOptions>
|
processor: ProcessorWrapper<BackgroundOptions>
|
||||||
|
|
||||||
|
opts: BackgroundOptions
|
||||||
|
|
||||||
constructor(opts: BackgroundOptions) {
|
constructor(opts: BackgroundOptions) {
|
||||||
this.processor = BackgroundBlur(opts.blurRadius)
|
this.processor = BackgroundBlur(opts.blurRadius)
|
||||||
|
this.opts = opts
|
||||||
}
|
}
|
||||||
|
|
||||||
async init(opts: ProcessorOptions<Track.Kind>) {
|
async init(opts: ProcessorOptions<Track.Kind>) {
|
||||||
@@ -45,4 +48,10 @@ export class BackgroundBlurTrackProcessorJsWrapper
|
|||||||
get options() {
|
get options() {
|
||||||
return (this.processor.transformer as BackgroundTransformer).options
|
return (this.processor.transformer as BackgroundTransformer).options
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clone() {
|
||||||
|
return new BackgroundBlurTrackProcessorJsWrapper({
|
||||||
|
blurRadius: this.options!.blurRadius,
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ export interface BackgroundBlurProcessorInterface
|
|||||||
extends TrackProcessor<Track.Kind> {
|
extends TrackProcessor<Track.Kind> {
|
||||||
update(opts: BackgroundOptions): void
|
update(opts: BackgroundOptions): void
|
||||||
options: BackgroundOptions
|
options: BackgroundOptions
|
||||||
|
clone(): BackgroundBlurProcessorInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
export class BackgroundBlurFactory {
|
export class BackgroundBlurFactory {
|
||||||
|
|||||||
Reference in New Issue
Block a user