trtc-sdk-v5 5.10.2-wasm.2 → 5.11.0-beta.1

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.
Files changed (39) hide show
  1. package/assets/audioProcessor-wasm.js +1 -0
  2. package/assets/debug-dialog.js +2 -2
  3. package/assets/face_detection/blaze_face_short_range.tflite +0 -0
  4. package/assets/face_detection/vision_wasm_internal.gz +0 -0
  5. package/assets/face_detection/vision_wasm_internal.js +20 -0
  6. package/assets/face_detection/vision_wasm_nosimd_internal.gz +0 -0
  7. package/assets/face_detection/vision_wasm_nosimd_internal.js +20 -0
  8. package/index.d.ts +89 -24
  9. package/package.json +6 -4
  10. package/plugins/cdn-streaming/package.json +1 -1
  11. package/plugins/cross-room/package.json +1 -1
  12. package/plugins/custom-encryption/package.json +1 -1
  13. package/plugins/device-detector/package.json +1 -1
  14. package/plugins/small-stream-auto-switcher/package.json +9 -0
  15. package/plugins/small-stream-auto-switcher/small-stream-auto-switcher.esm.d.ts +19 -0
  16. package/plugins/small-stream-auto-switcher/small-stream-auto-switcher.esm.js +1 -0
  17. package/plugins/small-stream-auto-switcher/small-stream-auto-switcher.umd.js +1 -0
  18. package/plugins/video-decoder/package.json +1 -1
  19. package/plugins/video-decoder/video-decoder.esm.js +1 -1
  20. package/plugins/video-decoder/video-decoder.umd.js +1 -1
  21. package/plugins/video-effect/basic-beauty/basic-beauty.esm.js +1 -1
  22. package/plugins/video-effect/basic-beauty/basic-beauty.umd.js +1 -1
  23. package/plugins/video-effect/basic-beauty/package.json +1 -1
  24. package/plugins/video-effect/beauty/package.json +1 -1
  25. package/plugins/video-effect/video-mixer/package.json +29 -0
  26. package/plugins/video-effect/video-mixer/video-mixer.esm.d.ts +24 -0
  27. package/plugins/video-effect/video-mixer/video-mixer.esm.js +1 -0
  28. package/plugins/video-effect/video-mixer/video-mixer.umd.js +1 -0
  29. package/plugins/video-effect/virtual-background/package.json +1 -1
  30. package/plugins/video-effect/virtual-background/virtual-background.esm.js +1 -1
  31. package/plugins/video-effect/virtual-background/virtual-background.umd.js +1 -1
  32. package/plugins/video-effect/watermark/package.json +1 -1
  33. package/plugins/video-effect/watermark/watermark.esm.js +1 -1
  34. package/plugins/video-effect/watermark/watermark.umd.js +1 -1
  35. package/plugins/voice-changer/package.json +1 -1
  36. package/trtc.esm.js +43 -64
  37. package/trtc.js +1 -1
  38. package/assets/av_processing.wasm +0 -0
  39. package/assets/worker.js +0 -17
package/index.d.ts CHANGED
@@ -6,9 +6,12 @@ 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';
11
+ import { InitAudioProcessorOptions, UpdateAudioProcessorOptions } from 'trtc-js-sdk-core';
9
12
 
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;
13
+ export { CDNStreamingOptions, DeviceDetectorOptions, VirtualBackgroundOptions, UpdateVirtualBackgroundOptions, WatermarkOptions, BeautyOptions, UpdateBeautyOptions, BasicBeautyOptions, StartCrossRoomOption, UpdateCrossRoomOption, StopCrossRoomOption, SmallStreamAutoSwitcherOptions, VideoMixerOptions };
14
+ type TRTCPlugin = typeof CrossRoom | typeof CDNStreaming | typeof DeviceDetector | typeof VirtualBackground | typeof Watermark | typeof Beauty | typeof BasicBeauty | typeof CustomEncryption | typeof SmallStreamAutoSwitcher | typeof VideoMixer;
12
15
  export declare const enum ExperimentalAPIFunction {
13
16
  EnableAudioFrameEvent = 'enableAudioFrameEvent'
14
17
  }
@@ -18,21 +21,27 @@ export declare type PluginStartOptionsMap = {
18
21
  'CDNStreaming': CDNStreamingOptions;
19
22
  'VirtualBackground': VirtualBackgroundOptions;
20
23
  'Watermark': WatermarkOptions;
24
+ 'VideoMixer': VideoMixerOptions;
21
25
  'Beauty': BeautyOptions;
22
26
  'BasicBeauty': BasicBeautyOptions;
23
27
  'DeviceDetector': DeviceDetectorOptions;
24
28
  'Debug': undefined;
25
29
  'CrossRoom': StartCrossRoomOption;
26
30
  'CustomEncryption': EncryptionOptions;
31
+ 'SmallStreamAutoSwitcher': SmallStreamAutoSwitcherOptions;
32
+ 'AudioProcessor': InitAudioProcessorOptions;
27
33
  };
28
34
 
29
35
  export declare type PluginUpdateOptionsMap = {
30
36
  'AudioMixer': UpdateAudioMixerOptions;
31
37
  'CDNStreaming': CDNStreamingOptions;
32
38
  'VirtualBackground': UpdateVirtualBackgroundOptions;
39
+ 'Watermark': WatermarkOptions;
40
+ 'VideoMixer': VideoMixerOptions;
33
41
  'Beauty': UpdateBeautyOptions;
34
42
  'BasicBeauty': BasicBeautyOptions;
35
43
  'CrossRoom': UpdateCrossRoomOption;
44
+ 'AudioProcessor': UpdateAudioProcessorOptions;
36
45
  };
37
46
 
38
47
  export declare type PluginStopOptionsMap = {
@@ -41,11 +50,14 @@ export declare type PluginStopOptionsMap = {
41
50
  'CDNStreaming': CDNStreamingOptions;
42
51
  'VirtualBackground': undefined;
43
52
  'Watermark': undefined;
53
+ 'VideoMixer': undefined;
44
54
  'Beauty': undefined;
45
55
  'BasicBeauty': undefined;
46
56
  'DeviceDetector': undefined;
47
57
  'Debug': undefined;
48
58
  'CrossRoom': StopCrossRoomOption | undefined;
59
+ 'SmallStreamAutoSwitcher': undefined;
60
+ 'AudioProcessor': undefined;
49
61
  };
50
62
 
51
63
  export declare class RtcError extends Error implements RTCErrorInterface {
@@ -327,6 +339,7 @@ export declare interface LocalVideoConfig {
327
339
  qosPreference?: typeof TRTCType.QOS_PREFERENCE_SMOOTH | typeof TRTCType.QOS_PREFERENCE_CLEAR;
328
340
  videoTrack?: MediaStreamTrack;
329
341
  avoidCropping?: boolean;
342
+ rotation?: 0 | 90 | 180 | 270;
330
343
  };
331
344
  }
332
345
  export interface TurnServerOptions {
@@ -368,6 +381,13 @@ export interface PlayoutDelay {
368
381
  max: number;
369
382
  }
370
383
 
384
+ export declare interface SwitchRoomConfig {
385
+ roomId?: number,
386
+ strRoomId?: string;
387
+ privateMapKey?: string;
388
+ userSig?: string;
389
+ }
390
+
371
391
  export declare interface ScreenShareConfig {
372
392
  view?: string | HTMLElement | HTMLElement[] | null;
373
393
  publish?: boolean;
@@ -614,7 +634,7 @@ export declare interface StopAudioMixerOptions {
614
634
  id: string;
615
635
  }
616
636
  export declare interface AIDenoiserOptions {
617
- assetsPath: string;
637
+ assetsPath?: string;
618
638
  sdkAppId: number;
619
639
  userId: string;
620
640
  userSig: string;
@@ -1137,6 +1157,7 @@ export declare interface TRTCEventTypes {
1137
1157
  [TRTCEvent.ERROR]: [RtcError];
1138
1158
  [TRTCEvent.AUTOPLAY_FAILED]: [{
1139
1159
  userId: string;
1160
+ mediaType: 'audio' | 'video' | 'screen';
1140
1161
  resume: () => Promise<void>;
1141
1162
  }];
1142
1163
  [TRTCEvent.KICKED_OUT]: [{
@@ -1232,6 +1253,14 @@ export declare class TRTC {
1232
1253
  *
1233
1254
  * **Note:**
1234
1255
  * - You must create a TRTC object first and call its methods and listen to its events to implement various functions required by the business.
1256
+ * @param {Array=} options.plugins List of registered plugins (optional).
1257
+ * @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)
1258
+ * @param {string=} options.assetsPath The address of the static resource file that the plugin depends on (optional).
1259
+ * - Publish the node_modules/trtc-sdk-v5/assets directory to CDN or static resource server.
1260
+ * - 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.
1261
+ * @param {string=} options.userDefineRecordId is used to set the userDefineRecordId of cloud recording (optional).
1262
+ * - [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.
1263
+ * - [Reference document] [Cloud recording](https://trtc.io/document/45169?product=rtcengine&menulabel=serverfeaturesapis).
1235
1264
  * @example
1236
1265
  * // Create a TRTC object
1237
1266
  * const trtc = TRTC.create();
@@ -1367,27 +1396,61 @@ export declare class TRTC {
1367
1396
  * await trtc.switchRole(TRTC.TYPE.ROLE_ANCHOR, { privateMapKey: 'your new privateMapKey' });
1368
1397
  */
1369
1398
  switchRole(role: UserRole, option?: {
1370
- privateMapKey?: string;
1371
- latencyLevel?: number;
1372
- }): Promise<void>;
1373
- /**
1374
- * Destroy the TRTC instance <br/>
1375
- *
1376
- * 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.
1377
- *
1378
- * Note:
1379
- * - The trtc instance after destruction cannot be used again.
1380
- * - 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.
1381
- *
1399
+ privateMapKey?: string;
1400
+ latencyLevel?: number;
1401
+ }): Promise<void>;
1402
+ /**
1403
+ * Switch a video call room.<br>
1404
+ * - 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.
1405
+ * - [Contact us](https://trtc.io/contact) to enable this API.
1406
+ *
1407
+ * @param {object} options Switch room parameters
1408
+ * @param {number=} options.roomId
1409
+ * the value must be an integer between 1 and 4294967294<br>
1410
+ * <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>
1411
+ * @param {string=} options.strRoomId
1412
+ * String type room id, the length is limited to 64 bytes, and only supports the following characters:
1413
+ * - Uppercase and lowercase English letters (a-zA-Z)
1414
+ * - Numbers (0-9)
1415
+ * - Space ! # $ % & ( ) + - : ; < = . > ? @ [ ] ^ _ { } | ~ ,
1416
+ * @param {string} options.userSig UserSig signature <br>
1417
+ * Please refer to [UserSig related](https://trtc.io/document/35166) for the calculation method of userSig.
1418
+ * <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>
1419
+ * @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=).
1420
+ * @throws
1421
+ * - {@link module:ERROR_CODE.INVALID_PARAMETER INVALID_PARAMETER}
1422
+ * - {@link module:ERROR_CODE.OPERATION_FAILED OPERATION_FAILED}
1423
+ * - {@link module:ERROR_CODE.OPERATION_ABORT OPERATION_ABORT}
1424
+ * - {@link module:ERROR_CODE.SERVER_ERROR SERVER_ERROR}
1382
1425
  * @example
1383
- * // When the call is over
1384
- * await trtc.exitRoom();
1385
- * // If the trtc is no longer needed, destroy the trtc and release the reference.
1386
- * trtc.destroy();
1387
- * trtc = null;
1388
- * @throws {@link module:ERROR_CODE.OPERATION_FAILED OPERATION_FAILED}
1389
- * @memberof TRTC
1390
- */
1426
+ * const trtc = TRTC.create();
1427
+ * await trtc.enterRoom({
1428
+ * ...
1429
+ * roomId: 8888,
1430
+ * scene: TRTC.TYPE.SCENE_LIVE,
1431
+ * role: TRTC.TYPE.ROLE_AUDIENCE
1432
+ * });
1433
+ * await trtc.switchRoom({ roomId: 9999 });
1434
+ */
1435
+ switchRoom(params: SwitchRoomConfig): Promise<void>;
1436
+ /**
1437
+ * Destroy the TRTC instance <br/>
1438
+ *
1439
+ * 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.
1440
+ *
1441
+ * Note:
1442
+ * - The trtc instance after destruction cannot be used again.
1443
+ * - 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.
1444
+ *
1445
+ * @example
1446
+ * // When the call is over
1447
+ * await trtc.exitRoom();
1448
+ * // If the trtc is no longer needed, destroy the trtc and release the reference.
1449
+ * trtc.destroy();
1450
+ * trtc = null;
1451
+ * @throws {@link module:ERROR_CODE.OPERATION_FAILED OPERATION_FAILED}
1452
+ * @memberof TRTC
1453
+ */
1391
1454
  destroy(): void;
1392
1455
  /**
1393
1456
  * Start collecting audio from the local microphone and publish it to the current room.
@@ -1521,6 +1584,7 @@ export declare class TRTC {
1521
1584
  * @param {string | VideoProfile} [config.option.profile] - Video encoding parameters for the main video.
1522
1585
  * @param {string | boolean | VideoProfile} [config.option.small] - Video encoding parameters for the small video. Refer to {@tutorial 27-advanced-small-stream}
1523
1586
  * @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})
1587
+ * @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
1588
  * @throws
1525
1589
  * - {@link module:ERROR_CODE.ENV_NOT_SUPPORTED ENV_NOT_SUPPORTED}
1526
1590
  * - {@link module:ERROR_CODE.INVALID_PARAMETER INVALID_PARAMETER}
@@ -1583,6 +1647,7 @@ export declare class TRTC {
1583
1647
  * @param {string | VideoProfile} [config.option.profile] - Video encoding parameters for the main stream
1584
1648
  * @param {string | boolean | VideoProfile} [config.option.small] - Video encoding parameters for the small video. Refer to {@tutorial 27-advanced-small-stream}
1585
1649
  * @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})
1650
+ * @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
1651
  * @throws
1587
1652
  * - {@link module:ERROR_CODE.INVALID_PARAMETER INVALID_PARAMETER}
1588
1653
  * - {@link module:ERROR_CODE.DEVICE_ERROR DEVICE_ERROR}
@@ -1901,7 +1966,7 @@ export declare class TRTC {
1901
1966
  * @param {STREAM_TYPE_MAIN|STREAM_TYPE_SUB} [config.streamType] - stream type:
1902
1967
  * - {@link module:TYPE.STREAM_TYPE_MAIN TRTC.TYPE.STREAM_TYPE_MAIN}: Main stream (user's camera)(default)
1903
1968
  * - {@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.
1969
+ * @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
1970
  * @returns {MediaStreamTrack|null} Video track
1906
1971
  * @memberof TRTC
1907
1972
  * @example
package/package.json CHANGED
@@ -1,10 +1,12 @@
1
1
  {
2
2
  "name": "trtc-sdk-v5",
3
- "version": "5.10.2-wasm.2",
3
+ "version": "5.11.0-beta.1",
4
4
  "description": "Tencent Cloud RTC SDK for Web",
5
- "module": "trtc.esm.js",
6
- "type": "module",
5
+ "main": "trtc.js",
7
6
  "types": "index.d.ts",
7
+ "dependencies": {
8
+ "webrtc-adapter": "^8.2.3"
9
+ },
8
10
  "keywords": [
9
11
  "webrtc",
10
12
  "TRTC",
@@ -27,4 +29,4 @@
27
29
  },
28
30
  "author": "Tencent Cloud Client R&D Center",
29
31
  "license": "ISC"
30
- }
32
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/cdn-streaming",
3
- "version": "5.10.2-wasm.2",
3
+ "version": "5.11.0-beta.1",
4
4
  "description": "TRTC Web SDK 5.x CDN streaming plugin",
5
5
  "main": "./cdn-streaming.esm.js",
6
6
  "module": "./cdn-streaming.esm.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/cross-room",
3
- "version": "5.10.2-wasm.2",
3
+ "version": "5.11.0-beta.1",
4
4
  "description": "TRTC Web SDK 5.x Cross Room plugin",
5
5
  "main": "./cross-room.esm.js",
6
6
  "module": "./cross-room.esm.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/custom-encryption",
3
- "version": "5.10.2-wasm.2",
3
+ "version": "5.11.0-beta.1",
4
4
  "main": "./custom-encryption.esm.js",
5
5
  "module": "./custom-encryption.esm.js",
6
6
  "types": "./custom-encryption.esm.d.ts"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/device-detector",
3
- "version": "5.10.2-wasm.2",
3
+ "version": "5.11.0-beta.1",
4
4
  "description": "TRTC Web SDK 5.x device detector plugin",
5
5
  "main": "./device-detector.esm.js",
6
6
  "module": "./device-detector.esm.js",
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "@rtc-plugin/small-stream-auto-switcher",
3
+ "version": "5.11.0-beta.1",
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;