diff --git a/.changeset/large-eyes-explode.md b/.changeset/large-eyes-explode.md
new file mode 100644
index 0000000..53b37ed
--- /dev/null
+++ b/.changeset/large-eyes-explode.md
@@ -0,0 +1,5 @@
+---
+'@livekit/track-processors': minor
+---
+
+Replace ProcessorPipeline with ProcessorWrapper, allowing for direct transformer updates
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index 419410c..82fc947 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -21,14 +21,14 @@ jobs:
node-version: 16.x
- name: Install Dependencies
- run: yarn
+ run: pnpm i
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
- publish: yarn release
+ publish: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
diff --git a/README.md b/README.md
index 3bf2278..977349c 100644
--- a/README.md
+++ b/README.md
@@ -3,33 +3,47 @@
## Install
```
-yarn add @livekit/track-processors
+npm add @livekit/track-processors
```
## Usage of prebuilt processors
+### Available processors
+
This package exposes `BackgroundBlur` and `VirtualBackground` as pre-prepared processor pipelines.
+- `BackgroundBlur(blurRadius)`
+- `VirtualBackground(imagePath)`
+
+### Usage example
+
```ts
import { BackgroundBlur } from '@livekit/track-processors';
const videoTrack = await createLocalVideoTrack();
-await videoTrack.setProcessor(BackgroundBlur(10));
+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: blur})
+}
+
+
```
-## Building your own processors
+## Developing your own processors
-A track processor consists of one or multiple transformers.
+A track processor is instantiated with a Transformer.
```ts
// src/index.ts
export const VirtualBackground = (imagePath: string) => {
- const pipeline = new ProcessorPipeline([new BackgroundTransformer({ imagePath })]);
+ const pipeline = new ProcessorWrapper(new BackgroundTransformer({ imagePath }));
return pipeline;
};
```
diff --git a/example/ali-kazal-tbw_KQE3Cbg-unsplash.jpg b/example/ali-kazal-tbw_KQE3Cbg-unsplash.jpg
new file mode 100644
index 0000000..c5f7e8f
Binary files /dev/null and b/example/ali-kazal-tbw_KQE3Cbg-unsplash.jpg differ
diff --git a/example/index.html b/example/index.html
index 50209b0..52a4589 100644
--- a/example/index.html
+++ b/example/index.html
@@ -92,6 +92,24 @@
LiveKit track processor sample
Flip Video
+
+
+