@byteplus/rtc 4.51.2 → 4.52.0
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/extension-ainr/index.js +1 -1
- package/extension-ainr/index.umd.js +1 -1
- package/extension-beauty/index.d.ts +123 -3
- package/extension-beauty/index.js +1 -1
- package/extension-beauty/index.umd.js +1 -1
- package/index.d.ts +288 -273
- package/index.esm.min.js +2 -2
- package/index.min.js +2 -2
- package/package.json +2 -2
|
@@ -21,10 +21,81 @@ export declare enum EffectBeautyMode {
|
|
|
21
21
|
*/
|
|
22
22
|
EFFECT_SHARPEN_MODE = 2
|
|
23
23
|
}
|
|
24
|
+
|
|
25
|
+
/** {en}
|
|
26
|
+
* @brief Virtual background mode.
|
|
27
|
+
*/
|
|
28
|
+
export declare enum BackgroundMode {
|
|
29
|
+
|
|
30
|
+
/** {en}
|
|
31
|
+
* @brief Blur background.
|
|
32
|
+
*/
|
|
33
|
+
BACKGROUND_BLUR = "blur",
|
|
34
|
+
|
|
35
|
+
/** {en}
|
|
36
|
+
* @brief Image background.
|
|
37
|
+
*/
|
|
38
|
+
BACKGROUND_IMAGE = "image"
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** {en}
|
|
42
|
+
* @brief The priority of the facial recognition AI algorithm.
|
|
43
|
+
*/
|
|
44
|
+
export declare enum BackgroundAIModelType {
|
|
45
|
+
|
|
46
|
+
/** {en}
|
|
47
|
+
* @brief Performance mode.
|
|
48
|
+
*/
|
|
49
|
+
PERFORMANCE = 0,
|
|
50
|
+
|
|
51
|
+
/** {en}
|
|
52
|
+
* @brief Quality mode.
|
|
53
|
+
*/
|
|
54
|
+
QUALITY = 1
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** {en}
|
|
58
|
+
* @brief Compatibility check result.
|
|
59
|
+
*/
|
|
60
|
+
export interface CompatibilityCheckResult {
|
|
61
|
+
|
|
62
|
+
/** {en}
|
|
63
|
+
* @brief Whether the system is compatible.
|
|
64
|
+
*   `true`: The system meets the requirements.
|
|
65
|
+
*   `false`: Incompatible.
|
|
66
|
+
*/
|
|
67
|
+
isCompatible: boolean;
|
|
68
|
+
|
|
69
|
+
/** {en}
|
|
70
|
+
* @brief Incompatible reasons.</br>
|
|
71
|
+
*   + 0: Other unknown reasons.
|
|
72
|
+
*   + 1: Browser does not support getUserMedia API.
|
|
73
|
+
*   + 2: Browser does not support WebAssembly.
|
|
74
|
+
*   + 3: Browser cannot get video input devices.
|
|
75
|
+
*   + 100: Failed to load WebAR SDK.
|
|
76
|
+
*/
|
|
77
|
+
reasons: number[];
|
|
78
|
+
}
|
|
24
79
|
export declare class IRTCBeautyExtension {
|
|
25
80
|
|
|
26
81
|
/** {en}
|
|
27
|
-
* @brief
|
|
82
|
+
* @brief Check the compatibility of current browser.
|
|
83
|
+
* @return Compatibility check result.
|
|
84
|
+
*/
|
|
85
|
+
checkCompatibility: () => Promise<CompatibilityCheckResult>;
|
|
86
|
+
|
|
87
|
+
/** {en}
|
|
88
|
+
* @brief Enable basic beauty effects.
|
|
89
|
+
* @notes + Call [setBeautyIntensity](#setbeautyintensity) to set the beauty effect intensity. If you do not set the intensity, the brightness, smoothness, and sharpness intensity will default to 0.5.
|
|
90
|
+
* + Call [disable](#disable) to turn off basic beauty effects.
|
|
91
|
+
* + This API is not applicable to screen capturing.
|
|
92
|
+
*/
|
|
93
|
+
enableBeauty: () => void;
|
|
94
|
+
|
|
95
|
+
/** {en}
|
|
96
|
+
* @hidden
|
|
97
|
+
* @deprecated since 4.52, use enableBeauty instead.
|
|
98
|
+
* @brief Enable basic beauty effects.
|
|
28
99
|
* @notes + Call [setBeautyIntensity](#setbeautyintensity) to set the beauty effect intensity. If you do not set the intensity, the brightness, smoothness, and sharpness intensity will default to 0.5.
|
|
29
100
|
* + Call [disable](#disable) to turn off basic beauty effects.
|
|
30
101
|
* + This API is not applicable to screen capturing.
|
|
@@ -32,18 +103,67 @@ export declare class IRTCBeautyExtension {
|
|
|
32
103
|
enable: () => void;
|
|
33
104
|
|
|
34
105
|
/** {en}
|
|
35
|
-
* @brief
|
|
106
|
+
* @brief Disable basic beauty effects.
|
|
107
|
+
*/
|
|
108
|
+
disableBeauty: () => void;
|
|
109
|
+
|
|
110
|
+
/** {en}
|
|
111
|
+
* @hidden
|
|
112
|
+
* @deprecated since 4.52, use disableBeauty instead.
|
|
113
|
+
* @brief Disable basic beauty effects.
|
|
36
114
|
*/
|
|
37
115
|
disable: () => void;
|
|
38
116
|
|
|
39
117
|
/** {en}
|
|
40
|
-
* @brief
|
|
118
|
+
* @brief Set the beauty effect intensity.
|
|
41
119
|
* @param beautyMode Basic beauty effect.
|
|
42
120
|
* @param intensity Beauty effect intensity in range of [0,1], default to 0.5. When you set it to 0, the beauty effect will be turned off.
|
|
43
121
|
* @notes + If you call this API before calling [enable](#enable), the default settings of beauty effect intensity will adjust accordingly.
|
|
44
122
|
* + If you destroy the engine, the beauty effect settings will be invalid.
|
|
45
123
|
*/
|
|
46
124
|
setBeautyIntensity: (beautyMode: EffectBeautyMode, intensity: number) => void;
|
|
125
|
+
|
|
126
|
+
/** {en}
|
|
127
|
+
* @brief Enable virtual background.
|
|
128
|
+
* @notes + Call [setBackgroundMode](#setbackgroundmode) to set the virtual background mode. If you do not set the mode, the blur background will be enabled.
|
|
129
|
+
* + Call [disableVirtualBackground](#disablevirtualbackground) to turn off virtual background.
|
|
130
|
+
* + This API is not applicable to screen capturing.
|
|
131
|
+
*/
|
|
132
|
+
enableVirtualBackground: () => void;
|
|
133
|
+
|
|
134
|
+
/** {en}
|
|
135
|
+
* @brief Disable virtual background.
|
|
136
|
+
*/
|
|
137
|
+
disableVirtualBackground: () => void;
|
|
138
|
+
|
|
139
|
+
/** {en}
|
|
140
|
+
* @brief Set the virtual background mode.
|
|
141
|
+
* @param mode Virtual background mode.
|
|
142
|
+
* @notes After turning on the virtual background, you can call this API to switch the used virtual background mode.
|
|
143
|
+
*/
|
|
144
|
+
setBackgroundMode: (mode: BackgroundMode) => void;
|
|
145
|
+
|
|
146
|
+
/** {en}
|
|
147
|
+
* @brief Get the current virtual background image.
|
|
148
|
+
* @return The URL of the current virtual background image.
|
|
149
|
+
*/
|
|
150
|
+
getBackgroundImage: () => string;
|
|
151
|
+
|
|
152
|
+
/** {en}
|
|
153
|
+
* @brief Set the virtual background image.
|
|
154
|
+
* @param url URL of the virtual background image.
|
|
155
|
+
* @return
|
|
156
|
+
* @notes + You can upload a .JPG, .PNG, or .JPEG file.
|
|
157
|
+
* + If the image’s aspect ratio doesn't match the video's, the shortest side (either height or width) of the image will be stretched proportionally to match the video. Then the image will be cropped to fill in the video.
|
|
158
|
+
* + The transparent area in the image will be filled with black.
|
|
159
|
+
*/
|
|
160
|
+
loadBackgroundImage: (url: string) => Promise<void>;
|
|
161
|
+
|
|
162
|
+
/** {en}
|
|
163
|
+
* @brief Set the priority of the facial recognition AI algorithm.
|
|
164
|
+
* @param type The priority of the facial recognition AI algorithm.
|
|
165
|
+
*/
|
|
166
|
+
setAIModelType: (type: BackgroundAIModelType) => void;
|
|
47
167
|
}
|
|
48
168
|
|
|
49
169
|
export {
|