♻️(frontend) refactor background processors to use the new API

Update the calls to the background processors imported from
livekit-track-processor so they use the new instantiation method
instead of the previous, now-deprecated one.
This commit is contained in:
lebaudantoine
2026-07-11 15:11:40 +02:00
committed by aleb_the_flash
parent f55fa0c42b
commit 1e5f5c4fe9
2 changed files with 10 additions and 4 deletions
+1
View File
@@ -19,6 +19,7 @@ and this project adheres to
- 🗑️(settings) deprecate SUMMARY_SERVICE_VERSION=1
- ⬆️(mail) update mjml to v5 and @html-to/text-cli
- 🚸(frontend) initialize the join input name with the persisted full name
- ♻️(frontend) refactor background processors to use the new API
### Fixed
@@ -1,8 +1,7 @@
import type { ProcessorOptions, Track } from 'livekit-client'
import {
BackgroundBlur,
ProcessorWrapper,
VirtualBackground,
BackgroundProcessor,
} from '@livekit/track-processors'
import {
type ProcessorConfig,
@@ -20,10 +19,16 @@ export class UnifiedBackgroundTrackProcessor implements BackgroundProcessorInter
if (opts.type === 'virtual') {
this.processorType = ProcessorType.VIRTUAL
this.processor = VirtualBackground(opts.imagePath)
this.processor = BackgroundProcessor({
mode: 'virtual-background',
imagePath: opts.imagePath,
})
} else if (opts.type === 'blur') {
this.processorType = ProcessorType.BLUR
this.processor = BackgroundBlur(opts.blurRadius)
this.processor = BackgroundProcessor({
mode: 'background-blur',
blurRadius: opts.blurRadius,
})
} else {
throw new Error(
'Must provide either imagePath for virtual background or blurRadius for blur'