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/assets/debug-dialog.js +2 -2
- package/index.d.ts +43 -64
- 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/video-decoder/package.json +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/virtual-background/package.json +1 -1
- package/plugins/video-effect/watermark/package.json +1 -1
- package/plugins/voice-changer/package.json +1 -1
- package/trtc.esm.js +32 -32
- package/trtc.js +1 -1
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
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
*
|
|
1380
|
-
*
|
|
1381
|
-
*
|
|
1382
|
-
*
|
|
1383
|
-
*
|
|
1384
|
-
*
|
|
1385
|
-
*
|
|
1386
|
-
*
|
|
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
|
-
*
|
|
1405
|
-
* await trtc.
|
|
1406
|
-
*
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
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