trtc-sdk-v5 5.10.2-beta.4 → 5.10.2-beta.5

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/index.d.ts CHANGED
@@ -9,7 +9,9 @@ import { CustomEncryption, EncryptionOptions } from './plugins/custom-encryption
9
9
 
10
10
  export { CDNStreamingOptions, DeviceDetectorOptions, VirtualBackgroundOptions, UpdateVirtualBackgroundOptions, WatermarkOptions, BeautyOptions, UpdateBeautyOptions, BasicBeautyOptions, StartCrossRoomOption, UpdateCrossRoomOption, StopCrossRoomOption };
11
11
  type TRTCPlugin = typeof CrossRoom | typeof CDNStreaming | typeof DeviceDetector | typeof VirtualBackground | typeof Watermark | typeof Beauty | typeof BasicBeauty | typeof CustomEncryption;
12
-
12
+ export declare const enum ExperimentalAPIFunction {
13
+ EnableAudioFrameEvent = 'enableAudioFrameEvent'
14
+ }
13
15
  export declare type PluginStartOptionsMap = {
14
16
  'AudioMixer': AudioMixerOptions;
15
17
  'AIDenoiser': AIDenoiserOptions;
@@ -101,7 +103,7 @@ export declare class RtcError extends Error implements RTCErrorInterface {
101
103
  static convertFrom(originError: Error, fnName?: string, fnParams?: any): RtcError;
102
104
  }
103
105
 
104
- export declare enum LOG_LEVEL {
106
+ export declare const enum LOG_LEVEL {
105
107
  /**
106
108
  * 输出所有日志
107
109
  */
@@ -366,13 +368,6 @@ export interface PlayoutDelay {
366
368
  max: number;
367
369
  }
368
370
 
369
- export declare interface SwitchRoomConfig {
370
- roomId?: number,
371
- strRoomId?: string;
372
- privateMapKey?: string;
373
- userSig?: string;
374
- }
375
-
376
371
  export declare interface ScreenShareConfig {
377
372
  view?: string | HTMLElement | HTMLElement[] | null;
378
373
  publish?: boolean;
@@ -453,12 +448,12 @@ export declare const enum TRTCStreamType {
453
448
  Main = 'main',
454
449
  Sub = 'sub'
455
450
  }
456
- export declare enum TRTCDeviceType {
451
+ export declare const enum TRTCDeviceType {
457
452
  Camera = 'camera',
458
453
  Microphone = 'microphone',
459
454
  Speaker = 'speaker'
460
455
  }
461
- export declare enum TRTCDeviceAction {
456
+ export declare const enum TRTCDeviceAction {
462
457
  Remove = 'remove',
463
458
  Add = 'add',
464
459
  Active = 'active'
@@ -647,7 +642,7 @@ export declare interface LocalStatistic {
647
642
  videoType: TRTCVideoType;
648
643
  }[];
649
644
  }
650
- export declare enum TRTCVideoType {
645
+ export declare const enum TRTCVideoType {
651
646
  Big = 'big',
652
647
  Small = 'small',
653
648
  Sub = 'sub'
@@ -670,7 +665,7 @@ export declare interface VideoFrameConfig {
670
665
  userId?: string;
671
666
  streamType?: TRTCStreamType;
672
667
  }
673
- export declare enum AutoStartPluginName {
668
+ export declare const enum AutoStartPluginName {
674
669
  Debug = 'Debug'
675
670
  }
676
671
 
@@ -1372,58 +1367,27 @@ export declare class TRTC {
1372
1367
  * await trtc.switchRole(TRTC.TYPE.ROLE_ANCHOR, { privateMapKey: 'your new privateMapKey' });
1373
1368
  */
1374
1369
  switchRole(role: UserRole, option?: {
1375
- privateMapKey?: string;
1376
- latencyLevel?: number;
1377
- }): Promise<void>;
1378
- /**
1379
- * Switch a video call room.<br>
1380
- * - 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.
1381
- * - [Contact us](https://trtc.io/contact) to enable this API.
1382
- *
1383
- * @param {object} options Switch room parameters
1384
- * @param {string} options.userSig UserSig signature <br>
1385
- * Please refer to [UserSig related](https://www.tencentcloud.com/document/product/647/35166) for the calculation method of userSig.
1386
- * <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>
1387
- * @param {string=} options.strRoomId
1388
- * @param {number=} options.roomId
1389
- * the value must be an integer between 1 and 4294967294<br>
1390
- * <font color="red">Note: The type of the new room must be the same as the old room. For example, both are numeric type roomId.</font>
1391
- * @param {string=} options.strRoomId
1392
- * String type room id, the length is limited to 64 bytes, and only supports the following characters:
1393
- * - Uppercase and lowercase English letters (a-zA-Z)
1394
- * - Numbers (0-9)
1395
- * - Space ! # $ % & ( ) + - : ; < = . > ? @ [ ] ^ _ { } | ~ ,
1396
- * <font color="red">Note: One of roomId and strRoomId must be passed in. If both are passed in, the numeric type roomId will be selected first.</font>
1397
- * @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=).
1398
- * @throws
1399
- * - {@link module:ERROR_CODE.INVALID_PARAMETER INVALID_PARAMETER}
1400
- * - {@link module:ERROR_CODE.OPERATION_FAILED OPERATION_FAILED}
1401
- * - {@link module:ERROR_CODE.OPERATION_ABORT OPERATION_ABORT}
1402
- * - {@link module:ERROR_CODE.SERVER_ERROR SERVER_ERROR}
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
+ *
1403
1382
  * @example
1404
- * const trtc = TRTC.create();
1405
- * await trtc.enterRoom({ roomId: 8888, sdkAppId, userId, userSig });
1406
- * await trtc.switchRoom({ roomId: 9999 });
1407
- */
1408
- switchRoom(params: SwitchRoomConfig): Promise<void>;
1409
- /**
1410
- * Destroy the TRTC instance <br/>
1411
- *
1412
- * 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.
1413
- *
1414
- * Note:
1415
- * - The trtc instance after destruction cannot be used again.
1416
- * - 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.
1417
- *
1418
- * @example
1419
- * // When the call is over
1420
- * await trtc.exitRoom();
1421
- * // If the trtc is no longer needed, destroy the trtc and release the reference.
1422
- * trtc.destroy();
1423
- * trtc = null;
1424
- * @throws {@link module:ERROR_CODE.OPERATION_FAILED OPERATION_FAILED}
1425
- * @memberof TRTC
1426
- */
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
+ */
1427
1391
  destroy(): void;
1428
1392
  /**
1429
1393
  * Start collecting audio from the local microphone and publish it to the current room.
@@ -2060,6 +2024,21 @@ export declare class TRTC {
2060
2024
  * })
2061
2025
  */
2062
2026
  sendCustomMessage(message: CustomMessageData): void;
2027
+ /**
2028
+ * call experimental API
2029
+ *
2030
+ * | API name | options | description |
2031
+ * | ------------------- | ----------------------------------------------- | ------------------------------------------------------------ |
2032
+ * | enableAudioFrameEvent | - enable type: `boolean` <br></br> - userId type: `string` <br></br> - sampleRate type: `number` <br></br> - channelCount type: `number` <br></br>| Configure the callback data of {@link module:EVENT.AUDIO_FRAME AUDIO_FRAME} event |
2033
+ * @private
2034
+ * @param {string} name
2035
+ * @param {object} options
2036
+ * @example
2037
+ * await trtc.callExperimentalAPI('enableAudioFrameEvent', { enable: true, userId: 'user_A'}) // 监听远端用户 user_A 的音频数据,默认 pcm 数据为 48kHZ,单声道
2038
+ * await trtc.callExperimentalAPI('enableAudioFrameEvent', { enable: true, userId: '*', sampleRate: 16000, channelCount: 2 }) // 监听所有远端音频数据,设置 pcm 数据为 16kHZ,双声道
2039
+ * await trtc.callExperimentalAPI('enableAudioFrameEvent', { enable: false, userId: '', sampleRate: 48000, channelCount: 1 }) // 取消监听本地麦克风数据
2040
+ */
2041
+ callExperimentalAPI(name: ExperimentalAPIFunction, options: any): Promise<void>;
2063
2042
  static EVENT: typeof TRTCEvent;
2064
2043
  static ERROR_CODE: {
2065
2044
  INVALID_PARAMETER: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trtc-sdk-v5",
3
- "version": "5.10.2-beta.4",
3
+ "version": "5.10.2-beta.5",
4
4
  "description": "Tencent Cloud RTC SDK for Web",
5
5
  "main": "trtc.js",
6
6
  "types": "index.d.ts",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/cdn-streaming",
3
- "version": "5.10.2-beta.4",
3
+ "version": "5.10.2-beta.5",
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-beta.4",
3
+ "version": "5.10.2-beta.5",
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-beta.4",
3
+ "version": "5.10.2-beta.5",
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-beta.4",
3
+ "version": "5.10.2-beta.5",
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",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/video-decoder",
3
- "version": "5.10.2-beta.4",
3
+ "version": "5.10.2-beta.5",
4
4
  "description": "Video decoder plugin for TRTC",
5
5
  "main": "./video-decoder.esm.js",
6
6
  "module": "./video-decoder.esm.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/basic-beauty",
3
- "version": "5.10.2-beta.4",
3
+ "version": "5.10.2-beta.5",
4
4
  "description": "TRTC Web SDK 5.x basic-beauty plugin",
5
5
  "main": "./basic-beauty.esm.js",
6
6
  "module": "./basic-beauty.esm.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/beauty",
3
- "version": "5.10.2-beta.4",
3
+ "version": "5.10.2-beta.5",
4
4
  "description": "TRTC Web SDK 5.x beauty plugin",
5
5
  "main": "./beauty.esm.js",
6
6
  "module": "./beauty.esm.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/virtual-background",
3
- "version": "5.10.2-beta.4",
3
+ "version": "5.10.2-beta.5",
4
4
  "description": "TRTC Web SDK 5.x virtual background plugin",
5
5
  "main": "./virtual-background.esm.js",
6
6
  "module": "./virtual-background.esm.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/watermark",
3
- "version": "5.10.2-beta.4",
3
+ "version": "5.10.2-beta.5",
4
4
  "description": "TRTC Web SDK 5.x watermark plugin",
5
5
  "main": "./watermark.esm.js",
6
6
  "module": "./watermark.esm.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/voice-changer",
3
- "version": "5.10.2-beta.4",
3
+ "version": "5.10.2-beta.5",
4
4
  "description": "",
5
5
  "main": "./voice-changer.esm.js",
6
6
  "keywords": [],