@cloudflare/realtimekit-virtual-background 0.0.2-staging.2 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,10 +4,10 @@
4
4
  <img src="https://docs.realtime.cloudflare.com/logo/cf.svg" alt="Logo" width="120">
5
5
  </a>
6
6
 
7
- <h3 align="center">RealtimeKit Video Background Manager</h3>
7
+ <h3 align="center">RealtimeKit Video Background Transformer</h3>
8
8
 
9
9
  <p align="center">
10
- A Package that allows ease of use for RealtimeKit's video middlewares
10
+ A package that adds video background & blur to participant video feeds in your RealtimeKit Meetings.
11
11
  <br />
12
12
  <a href="https://docs.realtime.cloudflare.com"><strong>Explore the docs »</strong></a>
13
13
  <br />
@@ -38,7 +38,9 @@
38
38
  <!-- ABOUT THE PROJECT -->
39
39
  ## About The Project
40
40
 
41
- The goal of Video Background Transformer is to create RealtimeKit Meetings' VideoMiddlewares with ease and make it fun to play around with.
41
+ This package provides the foundation to add video background and blur to a participant's video feed in your RealtimeKit Meeting with your custom UI implementation.
42
+
43
+ If you are using the `rtk-meeting` component directly and prefer abstraction over this package, refer to [UI Kit Addons](https://www.npmjs.com/package/@cloudflare/realtimekit-ui-addons).
42
44
 
43
45
  ### Built With
44
46
 
@@ -49,24 +51,15 @@ The goal of Video Background Transformer is to create RealtimeKit Meetings' Vide
49
51
  <!-- GETTING STARTED -->
50
52
  ## Getting Started
51
53
 
52
- ### Prerequisites
53
- * npm
54
- * Web Core Version >= 2.0 (Web Core, React Web Core, Angular Web Core etc.)
55
- * UI Kit Version >= 2.0 (UI Kit, React UI Kit, Angular UI Kit etc.)
56
-
57
54
  ### Installation
58
55
 
59
56
  ```sh
60
57
  npm install @cloudflare/realtimekit-virtual-background
61
58
  ```
62
59
 
63
-
64
-
65
60
  <!-- USAGE EXAMPLES -->
66
61
  ## Usage
67
62
 
68
- **_Note:_** Make sure that you are using the 2.x versions of Web Core & UI Kit.
69
-
70
63
  Disable the default per frame rendering of video middleware to improve speed and quality by letting this middleware control it on its own.
71
64
 
72
65
  ```ts
@@ -90,10 +83,11 @@ meeting.self.addVideoMiddleware(
90
83
  await videoBackgroundTransformer.createStaticBackgroundVideoMiddleware(imageUrl)
91
84
  );
92
85
  ```
93
- 2. ```createBackgroundBlurVideoMiddleware``` expects ```blurLength``` as a parameter (4px by default) and blurs the background of the user by the given blurLength.
86
+
87
+ 2. ```createBackgroundBlurVideoMiddleware``` expects ```blurStrength``` (0-100) as a parameter (50% by default) and blurs the background of the user by the given blurStrength.
94
88
  ```ts
95
89
  meeting.self.addVideoMiddleware(
96
- await videoBackgroundTransformer.createBackgroundBlurVideoMiddleware(10)
90
+ await videoBackgroundTransformer.createBackgroundBlurVideoMiddleware(50)
97
91
  );
98
92
  ```
99
93
 
@@ -125,25 +119,4 @@ const videoBackgroundTransformer = await RealtimeKitVideoBackgroundTransformer.i
125
119
  targetFps: 35,
126
120
  }
127
121
  });
128
- ```
129
-
130
- <!-- CONTRIBUTING -->
131
- ## Contributing
132
-
133
- Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.
134
-
135
- 1. Fork the Project
136
- 2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
137
- 3. Commit your Changes (`git commit -m 'feat: Add some AmazingFeature'`)
138
- 4. Push to the Branch (`git push -u origin feature/AmazingFeature`)
139
- 5. Open a Pull Request
140
-
141
- <!-- LICENSE -->
142
- ## License
143
-
144
- Distributed under the MIT License. See [`LICENSE`](./LICENSE) for more information.
145
-
146
-
147
-
148
- <!-- MARKDOWN LINKS & IMAGES -->
149
- <!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
122
+ ```
package/package.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "name": "@cloudflare/realtimekit-virtual-background",
3
- "version": "0.0.2-staging.2",
4
- "description": "A Package that allows ease of use for RealtimeKit's video middlewares",
3
+ "version": "0.0.2",
5
4
  "main": "./dist/index.cjs.js",
6
5
  "module": "./dist/index.es.js",
7
6
  "exports": {
@@ -1,4 +1,4 @@
1
- import RealtimeKitMeeting from '@cloudflare/realtimekit';
1
+ import RTKMeeting from '@cloudflare/realtimekit';
2
2
  import { SegmentationConfig } from '../core/helpers/segmentationHelper';
3
3
  import { TFLite } from '../core/hooks/useTFLite';
4
4
  export type BlendMode = 'screen' | 'linearDodge';
@@ -14,7 +14,7 @@ export type PostProcessingConfig = {
14
14
  blendMode: BlendMode;
15
15
  };
16
16
  export interface InitParams {
17
- meeting: RealtimeKitMeeting;
17
+ meeting: RTKMeeting;
18
18
  segmentationConfig: SegmentationConfig;
19
19
  postProcessingConfig: PostProcessingConfig;
20
20
  tflite: TFLite;
@@ -28,7 +28,7 @@ export default class RealtimeKitVideoBackgroundTransformer {
28
28
  * which can be used to create video middlewares for RealtimeKit Meetings.
29
29
  */
30
30
  static init({ meeting, segmentationConfig: passedSegmentationConfig, postProcessingConfig: passedPostProcessingConfig, }: {
31
- meeting: RealtimeKitMeeting;
31
+ meeting: RTKMeeting;
32
32
  segmentationConfig?: Partial<SegmentationConfig>;
33
33
  postProcessingConfig?: Partial<PostProcessingConfig>;
34
34
  }): Promise<RealtimeKitVideoBackgroundTransformer>;