0.5.7 • Published 6 months ago
@livekit/track-processors v0.5.7
LiveKit track processors
Install
npm add @livekit/track-processorsUsage of prebuilt processors
Available processors
This package exposes the BackgroundBlur and VirtualBackground pre-prepared processor pipelines.
BackgroundBlur(blurRadius)VirtualBackground(imagePath)
Usage example
import { BackgroundBlur, supportsBackgroundProcessors, supportsModernBackgroundProcessors } from '@livekit/track-processors';
if(!supportsBackgroundProcessors()) {
throw new Error("this browser does not support background processors")
}
if(supportsModernBackgroundProcessors()) {
console.log("this browser supports modern APIs that are more performant");
}
const videoTrack = await createLocalVideoTrack();
const blur = BackgroundBlur(10);
await videoTrack.setProcessor(blur);
room.localParticipant.publishTrack(videoTrack);
async function disableBackgroundBlur() {
await videoTrack.stopProcessor();
}
async updateBlurRadius(radius) {
return blur.updateTransformerOptions({blurRadius: radius})
}Developing your own processors
A track processor is instantiated with a Transformer.
// src/index.ts
export const VirtualBackground = (imagePath: string) => {
const pipeline = new ProcessorWrapper(new BackgroundTransformer({ imagePath }));
return pipeline;
};Available base transformers
- BackgroundTransformer (can blur background or use a virtual background);
Running the sample app
This repository includes a small example app built on Vite. Run it with:
npm install
npm run sample0.5.7
6 months ago
0.5.4
8 months ago
0.5.3
8 months ago
0.5.6
7 months ago
0.5.5
7 months ago
0.5.0
8 months ago
0.4.1
8 months ago
0.4.0
8 months ago
0.5.2
8 months ago
0.5.1
8 months ago
0.3.3
12 months ago
0.3.2
2 years ago
0.3.1
2 years ago
0.3.0
2 years ago
0.2.1
2 years ago
0.2.0
2 years ago
0.2.7
2 years ago
0.2.6
2 years ago
0.2.8
2 years ago
0.2.3
2 years ago
0.2.2
2 years ago
0.2.5
2 years ago
0.2.4
2 years ago
0.1.8
2 years ago
0.1.7
2 years ago
0.1.6
2 years ago
0.1.5
2 years ago
0.1.4
2 years ago
0.1.3
2 years ago
0.1.2
2 years ago
0.1.1
2 years ago
0.1.0
2 years ago