mirror of
https://github.com/suitenumerique/meet.git
synced 2026-08-09 18:29:59 +00:00
♻️(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:
committed by
aleb_the_flash
parent
f55fa0c42b
commit
1e5f5c4fe9
+9
-4
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user