trtc-sdk-v5 5.10.2-wasm.2 → 5.10.2-wasm.3
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/assets/face_detection/blaze_face_short_range.tflite +0 -0
- package/assets/face_detection/vision_wasm_internal.gz +0 -0
- package/assets/face_detection/vision_wasm_internal.js +20 -0
- package/assets/face_detection/vision_wasm_nosimd_internal.gz +0 -0
- package/assets/face_detection/vision_wasm_nosimd_internal.js +20 -0
- package/assets/worker.js +8 -8
- package/index.d.ts +84 -23
- package/package.json +1 -1
- package/plugins/cdn-streaming/package.json +1 -1
- package/plugins/cross-room/package.json +1 -1
- package/plugins/custom-encryption/package.json +1 -1
- package/plugins/device-detector/package.json +1 -1
- package/plugins/small-stream-auto-switcher/package.json +9 -0
- package/plugins/small-stream-auto-switcher/small-stream-auto-switcher.esm.d.ts +19 -0
- package/plugins/small-stream-auto-switcher/small-stream-auto-switcher.esm.js +1 -0
- package/plugins/small-stream-auto-switcher/small-stream-auto-switcher.umd.js +1 -0
- package/plugins/video-decoder/package.json +1 -1
- package/plugins/video-decoder/video-decoder.esm.js +1 -1
- package/plugins/video-decoder/video-decoder.umd.js +1 -1
- package/plugins/video-effect/basic-beauty/basic-beauty.esm.js +1 -1
- package/plugins/video-effect/basic-beauty/basic-beauty.umd.js +1 -1
- package/plugins/video-effect/basic-beauty/package.json +1 -1
- package/plugins/video-effect/beauty/package.json +1 -1
- package/plugins/video-effect/video-mixer/package.json +29 -0
- package/plugins/video-effect/video-mixer/video-mixer.esm.d.ts +24 -0
- package/plugins/video-effect/video-mixer/video-mixer.esm.js +1 -0
- package/plugins/video-effect/video-mixer/video-mixer.umd.js +1 -0
- package/plugins/video-effect/virtual-background/package.json +1 -1
- package/plugins/video-effect/virtual-background/virtual-background.esm.js +1 -1
- package/plugins/video-effect/virtual-background/virtual-background.umd.js +1 -1
- package/plugins/video-effect/watermark/package.json +1 -1
- package/plugins/video-effect/watermark/watermark.esm.js +1 -1
- package/plugins/video-effect/watermark/watermark.umd.js +1 -1
- package/plugins/voice-changer/package.json +1 -1
- package/trtc.esm.js +60 -60
- package/trtc.js +1 -1
package/index.d.ts
CHANGED
|
@@ -6,9 +6,11 @@ import { Beauty, BeautyOptions, UpdateBeautyOptions } from './plugins/video-effe
|
|
|
6
6
|
import { BasicBeauty, BasicBeautyOptions } from './plugins/video-effect/basic-beauty';
|
|
7
7
|
import { CrossRoom, StartCrossRoomOption, UpdateCrossRoomOption, StopCrossRoomOption } from './plugins/cross-room';
|
|
8
8
|
import { CustomEncryption, EncryptionOptions } from './plugins/custom-encryption';
|
|
9
|
+
import { VideoMixerOptions, VideoMixer} from './plugins/video-effect/video-mixer'
|
|
10
|
+
import { SmallStreamAutoSwitcher, SmallStreamAutoSwitcherOptions } from './plugins/small-stream-auto-switcher';
|
|
9
11
|
|
|
10
|
-
export { CDNStreamingOptions, DeviceDetectorOptions, VirtualBackgroundOptions, UpdateVirtualBackgroundOptions, WatermarkOptions, BeautyOptions, UpdateBeautyOptions, BasicBeautyOptions, StartCrossRoomOption, UpdateCrossRoomOption, StopCrossRoomOption };
|
|
11
|
-
type TRTCPlugin = typeof CrossRoom | typeof CDNStreaming | typeof DeviceDetector | typeof VirtualBackground | typeof Watermark | typeof Beauty | typeof BasicBeauty | typeof CustomEncryption;
|
|
12
|
+
export { CDNStreamingOptions, DeviceDetectorOptions, VirtualBackgroundOptions, UpdateVirtualBackgroundOptions, WatermarkOptions, BeautyOptions, UpdateBeautyOptions, BasicBeautyOptions, StartCrossRoomOption, UpdateCrossRoomOption, StopCrossRoomOption, SmallStreamAutoSwitcherOptions, VideoMixerOptions };
|
|
13
|
+
type TRTCPlugin = typeof CrossRoom | typeof CDNStreaming | typeof DeviceDetector | typeof VirtualBackground | typeof Watermark | typeof Beauty | typeof BasicBeauty | typeof CustomEncryption | typeof SmallStreamAutoSwitcher | typeof VideoMixer;
|
|
12
14
|
export declare const enum ExperimentalAPIFunction {
|
|
13
15
|
EnableAudioFrameEvent = 'enableAudioFrameEvent'
|
|
14
16
|
}
|
|
@@ -18,18 +20,22 @@ export declare type PluginStartOptionsMap = {
|
|
|
18
20
|
'CDNStreaming': CDNStreamingOptions;
|
|
19
21
|
'VirtualBackground': VirtualBackgroundOptions;
|
|
20
22
|
'Watermark': WatermarkOptions;
|
|
23
|
+
'VideoMixer': VideoMixerOptions;
|
|
21
24
|
'Beauty': BeautyOptions;
|
|
22
25
|
'BasicBeauty': BasicBeautyOptions;
|
|
23
26
|
'DeviceDetector': DeviceDetectorOptions;
|
|
24
27
|
'Debug': undefined;
|
|
25
28
|
'CrossRoom': StartCrossRoomOption;
|
|
26
29
|
'CustomEncryption': EncryptionOptions;
|
|
30
|
+
'SmallStreamAutoSwitcher': SmallStreamAutoSwitcherOptions;
|
|
27
31
|
};
|
|
28
32
|
|
|
29
33
|
export declare type PluginUpdateOptionsMap = {
|
|
30
34
|
'AudioMixer': UpdateAudioMixerOptions;
|
|
31
35
|
'CDNStreaming': CDNStreamingOptions;
|
|
32
36
|
'VirtualBackground': UpdateVirtualBackgroundOptions;
|
|
37
|
+
'Watermark': WatermarkOptions;
|
|
38
|
+
'VideoMixer': VideoMixerOptions;
|
|
33
39
|
'Beauty': UpdateBeautyOptions;
|
|
34
40
|
'BasicBeauty': BasicBeautyOptions;
|
|
35
41
|
'CrossRoom': UpdateCrossRoomOption;
|
|
@@ -41,11 +47,13 @@ export declare type PluginStopOptionsMap = {
|
|
|
41
47
|
'CDNStreaming': CDNStreamingOptions;
|
|
42
48
|
'VirtualBackground': undefined;
|
|
43
49
|
'Watermark': undefined;
|
|
50
|
+
'VideoMixer': undefined;
|
|
44
51
|
'Beauty': undefined;
|
|
45
52
|
'BasicBeauty': undefined;
|
|
46
53
|
'DeviceDetector': undefined;
|
|
47
54
|
'Debug': undefined;
|
|
48
55
|
'CrossRoom': StopCrossRoomOption | undefined;
|
|
56
|
+
'SmallStreamAutoSwitcher': undefined;
|
|
49
57
|
};
|
|
50
58
|
|
|
51
59
|
export declare class RtcError extends Error implements RTCErrorInterface {
|
|
@@ -327,6 +335,7 @@ export declare interface LocalVideoConfig {
|
|
|
327
335
|
qosPreference?: typeof TRTCType.QOS_PREFERENCE_SMOOTH | typeof TRTCType.QOS_PREFERENCE_CLEAR;
|
|
328
336
|
videoTrack?: MediaStreamTrack;
|
|
329
337
|
avoidCropping?: boolean;
|
|
338
|
+
rotation?: 0 | 90 | 180 | 270;
|
|
330
339
|
};
|
|
331
340
|
}
|
|
332
341
|
export interface TurnServerOptions {
|
|
@@ -368,6 +377,13 @@ export interface PlayoutDelay {
|
|
|
368
377
|
max: number;
|
|
369
378
|
}
|
|
370
379
|
|
|
380
|
+
export declare interface SwitchRoomConfig {
|
|
381
|
+
roomId?: number,
|
|
382
|
+
strRoomId?: string;
|
|
383
|
+
privateMapKey?: string;
|
|
384
|
+
userSig?: string;
|
|
385
|
+
}
|
|
386
|
+
|
|
371
387
|
export declare interface ScreenShareConfig {
|
|
372
388
|
view?: string | HTMLElement | HTMLElement[] | null;
|
|
373
389
|
publish?: boolean;
|
|
@@ -1137,6 +1153,7 @@ export declare interface TRTCEventTypes {
|
|
|
1137
1153
|
[TRTCEvent.ERROR]: [RtcError];
|
|
1138
1154
|
[TRTCEvent.AUTOPLAY_FAILED]: [{
|
|
1139
1155
|
userId: string;
|
|
1156
|
+
mediaType: 'audio' | 'video' | 'screen';
|
|
1140
1157
|
resume: () => Promise<void>;
|
|
1141
1158
|
}];
|
|
1142
1159
|
[TRTCEvent.KICKED_OUT]: [{
|
|
@@ -1232,6 +1249,14 @@ export declare class TRTC {
|
|
|
1232
1249
|
*
|
|
1233
1250
|
* **Note:**
|
|
1234
1251
|
* - You must create a TRTC object first and call its methods and listen to its events to implement various functions required by the business.
|
|
1252
|
+
* @param {Array=} options.plugins List of registered plugins (optional).
|
|
1253
|
+
* @param {boolean=} [options.enableSEI=false] Whether to enable SEI sending and receiving function (optional). [Reference document](https://web.sdk.qcloud.com/trtc/webrtc/v5/doc/en/TRTC.html#sendSEIMessage)
|
|
1254
|
+
* @param {string=} options.assetsPath The address of the static resource file that the plugin depends on (optional).
|
|
1255
|
+
* - Publish the node_modules/trtc-sdk-v5/assets directory to CDN or static resource server.
|
|
1256
|
+
* - Set the assetsPath parameter to the CDN address, for example: `TRTC.create({ assetsPath: 'https://xxx/assets' })`, the SDK will load the relevant resource files on demand.
|
|
1257
|
+
* @param {string=} options.userDefineRecordId is used to set the userDefineRecordId of cloud recording (optional).
|
|
1258
|
+
* - [Recommended value] The length is limited to 64 bytes, and only uppercase and lowercase English letters (a-zA-Z), numbers (0-9), underscores, and hyphens are allowed.
|
|
1259
|
+
* - [Reference document] [Cloud recording](https://trtc.io/document/45169?product=rtcengine&menulabel=serverfeaturesapis).
|
|
1235
1260
|
* @example
|
|
1236
1261
|
* // Create a TRTC object
|
|
1237
1262
|
* const trtc = TRTC.create();
|
|
@@ -1367,27 +1392,61 @@ export declare class TRTC {
|
|
|
1367
1392
|
* await trtc.switchRole(TRTC.TYPE.ROLE_ANCHOR, { privateMapKey: 'your new privateMapKey' });
|
|
1368
1393
|
*/
|
|
1369
1394
|
switchRole(role: UserRole, option?: {
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
*
|
|
1375
|
-
*
|
|
1376
|
-
*
|
|
1377
|
-
*
|
|
1378
|
-
*
|
|
1379
|
-
*
|
|
1380
|
-
*
|
|
1381
|
-
*
|
|
1395
|
+
privateMapKey?: string;
|
|
1396
|
+
latencyLevel?: number;
|
|
1397
|
+
}): Promise<void>;
|
|
1398
|
+
/**
|
|
1399
|
+
* Switch a video call room.<br>
|
|
1400
|
+
* - Switch the video call room that the audience is watching in live scene. It is faster than exit old room and then entering the new room, and can optimize the opening time in live broadcast and other scenarios.
|
|
1401
|
+
* - [Contact us](https://trtc.io/contact) to enable this API.
|
|
1402
|
+
*
|
|
1403
|
+
* @param {object} options Switch room parameters
|
|
1404
|
+
* @param {number=} options.roomId
|
|
1405
|
+
* the value must be an integer between 1 and 4294967294<br>
|
|
1406
|
+
* <font color="red">Note: <br>1. The room to be switched and the current room must be of the same room type (both digital rooms or string rooms)<br> 2. Either roomId or strRoomId must be filled in. If both are filled in, roomId is preferred. </font>
|
|
1407
|
+
* @param {string=} options.strRoomId
|
|
1408
|
+
* String type room id, the length is limited to 64 bytes, and only supports the following characters:
|
|
1409
|
+
* - Uppercase and lowercase English letters (a-zA-Z)
|
|
1410
|
+
* - Numbers (0-9)
|
|
1411
|
+
* - Space ! # $ % & ( ) + - : ; < = . > ? @ [ ] ^ _ { } | ~ ,
|
|
1412
|
+
* @param {string} options.userSig UserSig signature <br>
|
|
1413
|
+
* Please refer to [UserSig related](https://trtc.io/document/35166) for the calculation method of userSig.
|
|
1414
|
+
* <font color="red">Note: If you omit this parameter, SDK will reuse the userSig passed in {@link TRTC#enterRoom enterRoom()}. If it has expired, switching room will fail.</font>
|
|
1415
|
+
* @param {boolean=} [options.privateMapKey] Key for entering a room. If permission control is required, please carry this parameter (empty or incorrect value will cause a failure in entering the room).<br>[privateMapKey permission configuration](https://www.tencentcloud.com/document/product/647/35157?lang=en&pg=).
|
|
1416
|
+
* @throws
|
|
1417
|
+
* - {@link module:ERROR_CODE.INVALID_PARAMETER INVALID_PARAMETER}
|
|
1418
|
+
* - {@link module:ERROR_CODE.OPERATION_FAILED OPERATION_FAILED}
|
|
1419
|
+
* - {@link module:ERROR_CODE.OPERATION_ABORT OPERATION_ABORT}
|
|
1420
|
+
* - {@link module:ERROR_CODE.SERVER_ERROR SERVER_ERROR}
|
|
1382
1421
|
* @example
|
|
1383
|
-
*
|
|
1384
|
-
* await trtc.
|
|
1385
|
-
*
|
|
1386
|
-
*
|
|
1387
|
-
*
|
|
1388
|
-
*
|
|
1389
|
-
*
|
|
1390
|
-
|
|
1422
|
+
* const trtc = TRTC.create();
|
|
1423
|
+
* await trtc.enterRoom({
|
|
1424
|
+
* ...
|
|
1425
|
+
* roomId: 8888,
|
|
1426
|
+
* scene: TRTC.TYPE.SCENE_LIVE,
|
|
1427
|
+
* role: TRTC.TYPE.ROLE_AUDIENCE
|
|
1428
|
+
* });
|
|
1429
|
+
* await trtc.switchRoom({ roomId: 9999 });
|
|
1430
|
+
*/
|
|
1431
|
+
switchRoom(params: SwitchRoomConfig): Promise<void>;
|
|
1432
|
+
/**
|
|
1433
|
+
* Destroy the TRTC instance <br/>
|
|
1434
|
+
*
|
|
1435
|
+
* After exiting the room, if the business side no longer needs to use trtc, you need to call this interface to destroy the trtc instance in time and release related resources.
|
|
1436
|
+
*
|
|
1437
|
+
* Note:
|
|
1438
|
+
* - The trtc instance after destruction cannot be used again.
|
|
1439
|
+
* - If you have entered the room, you need to call the {@link TRTC#exitRoom TRTC.exitRoom} interface to exit the room successfully before calling this interface to destroy trtc.
|
|
1440
|
+
*
|
|
1441
|
+
* @example
|
|
1442
|
+
* // When the call is over
|
|
1443
|
+
* await trtc.exitRoom();
|
|
1444
|
+
* // If the trtc is no longer needed, destroy the trtc and release the reference.
|
|
1445
|
+
* trtc.destroy();
|
|
1446
|
+
* trtc = null;
|
|
1447
|
+
* @throws {@link module:ERROR_CODE.OPERATION_FAILED OPERATION_FAILED}
|
|
1448
|
+
* @memberof TRTC
|
|
1449
|
+
*/
|
|
1391
1450
|
destroy(): void;
|
|
1392
1451
|
/**
|
|
1393
1452
|
* Start collecting audio from the local microphone and publish it to the current room.
|
|
@@ -1521,6 +1580,7 @@ export declare class TRTC {
|
|
|
1521
1580
|
* @param {string | VideoProfile} [config.option.profile] - Video encoding parameters for the main video.
|
|
1522
1581
|
* @param {string | boolean | VideoProfile} [config.option.small] - Video encoding parameters for the small video. Refer to {@tutorial 27-advanced-small-stream}
|
|
1523
1582
|
* @param {QOS_PREFERENCE_SMOOTH|QOS_PREFERENCE_CLEAR} [config.option.qosPreference] - Set the video encoding strategy for weak networks. Smooth first(default) ({@link module:TYPE.QOS_PREFERENCE_SMOOTH QOS_PREFERENCE_SMOOTH}) or Clear first ({@link module:TYPE.QOS_PREFERENCE_CLEAR QOS_ PREFERENCE_SMOOTH})
|
|
1583
|
+
* @param {0 | 90 | 180 | 270} [config.option.rotation] - Set the clockwise rotation angle of the local camera when publishing. Supports 90, 180, and 270
|
|
1524
1584
|
* @throws
|
|
1525
1585
|
* - {@link module:ERROR_CODE.ENV_NOT_SUPPORTED ENV_NOT_SUPPORTED}
|
|
1526
1586
|
* - {@link module:ERROR_CODE.INVALID_PARAMETER INVALID_PARAMETER}
|
|
@@ -1583,6 +1643,7 @@ export declare class TRTC {
|
|
|
1583
1643
|
* @param {string | VideoProfile} [config.option.profile] - Video encoding parameters for the main stream
|
|
1584
1644
|
* @param {string | boolean | VideoProfile} [config.option.small] - Video encoding parameters for the small video. Refer to {@tutorial 27-advanced-small-stream}
|
|
1585
1645
|
* @param {QOS_PREFERENCE_SMOOTH|QOS_PREFERENCE_CLEAR} [config.option.qosPreference] - Set the video encoding strategy for weak networks. Smooth first ({@link module:TYPE.QOS_PREFERENCE_SMOOTH QOS_PREFERENCE_SMOOTH}) or Clear first ({@link module:TYPE.QOS_PREFERENCE_CLEAR QOS_ PREFERENCE_SMOOTH})
|
|
1646
|
+
* @param {0 | 90 | 180 | 270} [config.option.rotation] - Set the clockwise rotation angle of the local camera when publishing. Supports 90, 180, and 270
|
|
1586
1647
|
* @throws
|
|
1587
1648
|
* - {@link module:ERROR_CODE.INVALID_PARAMETER INVALID_PARAMETER}
|
|
1588
1649
|
* - {@link module:ERROR_CODE.DEVICE_ERROR DEVICE_ERROR}
|
|
@@ -1901,7 +1962,7 @@ export declare class TRTC {
|
|
|
1901
1962
|
* @param {STREAM_TYPE_MAIN|STREAM_TYPE_SUB} [config.streamType] - stream type:
|
|
1902
1963
|
* - {@link module:TYPE.STREAM_TYPE_MAIN TRTC.TYPE.STREAM_TYPE_MAIN}: Main stream (user's camera)(default)
|
|
1903
1964
|
* - {@link module:TYPE.STREAM_TYPE_SUB TRTC.TYPE.STREAM_TYPE_SUB}: Sub stream (user's screen sharing)
|
|
1904
|
-
* @param {boolean} [config.processed=false] - Whether to get the processed videoTrack. The processed videoTrack is the videoTrack after the SDK processes the video frame, such as virtual background, mirror, watermark. The default value is false.
|
|
1965
|
+
* @param {boolean} [config.processed=false] - Whether to get the processed videoTrack. The processed videoTrack is the videoTrack after the SDK processes the video frame, such as virtual background, mirror, watermark, rotation. The default value is false.
|
|
1905
1966
|
* @returns {MediaStreamTrack|null} Video track
|
|
1906
1967
|
* @memberof TRTC
|
|
1907
1968
|
* @example
|
package/package.json
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@rtc-plugin/small-stream-auto-switcher",
|
|
3
|
+
"version": "5.10.2-wasm.3",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "./small-stream-auto-switcher.esm.js",
|
|
6
|
+
"keywords": [],
|
|
7
|
+
"module": "./small-stream-auto-switcher.esm.js",
|
|
8
|
+
"types": "./small-stream-auto-switcher.esm.d.ts"
|
|
9
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
export interface SmallStreamAutoSwitcherOptions {
|
|
3
|
+
rttPoorLimit?: number;
|
|
4
|
+
lossPoorLimit?: number;
|
|
5
|
+
poorDuration?: number;
|
|
6
|
+
rttGoodLimit?: number;
|
|
7
|
+
lossGoodLimit?: number;
|
|
8
|
+
goodDuration?: number;
|
|
9
|
+
sleepTime?: number;
|
|
10
|
+
maxAutoSwitchToSmallCount?: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export declare class SmallStreamAutoSwitcher {
|
|
14
|
+
start(options: SmallStreamAutoSwitcherOptions): Promise<void>;
|
|
15
|
+
update(options: SmallStreamAutoSwitcherOptions): Promise<void>;
|
|
16
|
+
stop(): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default SmallStreamAutoSwitcher;
|