♻️(frontend) simplify processor factory for transformer unification
Streamline processor factory logic to prepare for unified transformer class refactoring. Reduces complexity and establishes foundation for consolidated transformer approach.
This commit is contained in:
committed by
aleb_the_flash
parent
651d299068
commit
a8f1ee0530
@@ -41,21 +41,21 @@ export class BackgroundProcessorFactory {
|
|||||||
type: ProcessorType,
|
type: ProcessorType,
|
||||||
opts: BackgroundOptions
|
opts: BackgroundOptions
|
||||||
): BackgroundProcessorInterface | undefined {
|
): BackgroundProcessorInterface | undefined {
|
||||||
if (type === ProcessorType.BLUR) {
|
const isBlur = type === ProcessorType.BLUR
|
||||||
if (ProcessorWrapper.isSupported) {
|
const isVirtual = type === ProcessorType.VIRTUAL
|
||||||
return new BackgroundBlurTrackProcessorJsWrapper(opts)
|
|
||||||
}
|
if (!isBlur && !isVirtual) return undefined
|
||||||
if (BackgroundCustomProcessor.isSupported) {
|
|
||||||
return new BackgroundCustomProcessor(opts)
|
if (ProcessorWrapper.isSupported) {
|
||||||
}
|
return isBlur
|
||||||
} else if (type === ProcessorType.VIRTUAL) {
|
? new BackgroundBlurTrackProcessorJsWrapper(opts)
|
||||||
if (ProcessorWrapper.isSupported) {
|
: new BackgroundVirtualTrackProcessorJsWrapper(opts)
|
||||||
return new BackgroundVirtualTrackProcessorJsWrapper(opts)
|
|
||||||
}
|
|
||||||
if (BackgroundCustomProcessor.isSupported) {
|
|
||||||
return new BackgroundCustomProcessor(opts)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (BackgroundCustomProcessor.isSupported) {
|
||||||
|
return new BackgroundCustomProcessor(opts)
|
||||||
|
}
|
||||||
|
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user