trtc-electron-sdk 12.1.608 → 12.2.701

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/liteav/trtc.d.ts CHANGED
@@ -2,9 +2,14 @@
2
2
  import { EventEmitter } from 'events';
3
3
  import { TRTCConfig } from './Renderer/util';
4
4
  import { AudioMusicParam, Rect, TRTCAppScene, TRTCAudioEffectParam, TRTCAudioQuality, TRTCBeautyStyle, TRTCDeviceState, TRTCDeviceType, TRTCLogLevel, TRTCRenderParams, TRTCRoleType, TRTCSpeedTestResult, TRTCStatistics, TRTCSwitchRoomParam, TRTCVideoBufferType, TRTCVideoFillMode, TRTCAudioFrame, TRTCVideoPixelFormat, TRTCVideoRotation, TRTCVideoStreamType, TRTCVolumeInfo, TRTCWaterMarkSrcType, TRTCQualityInfo, TRTCPluginType, TRTCPluginInfo, TRTCVideoProcessPluginOptions, TRTCMediaEncryptDecryptPluginOptions, TRTCAudioRecordingParams, TRTCScreenCaptureSourceInfo, TRTCScreenCaptureProperty, TRTCSpeedTestParams, TRTCRecordType, TRTCDeviceInfo, TRTCCameraCaptureParams, TRTCImageBuffer, TRTCInitConfig, TRTCAudioParallelParams, TRTCVoiceReverbType, TRTCVoiceChangerType, TRTCMusicPlayObserver, TRTCAudioFrameCallback, TRTCAudioProcessPluginOptions } from './trtc_define';
5
+ import TRTCMediaMixingManager from './extensions/MediaMixingManager';
5
6
  export * from './trtc_define';
6
7
  export * from './trtc_code';
7
8
  export * from './vod_player';
9
+ export * from './extensions/DeviceManager';
10
+ export * from './extensions/AudioEffectManager';
11
+ export * from './extensions/MediaMixingManager';
12
+ export * from './extensions/PluginManager';
8
13
  /**
9
14
  * 腾讯云视频通话功能的主要接口类
10
15
  *
@@ -20,8 +25,10 @@ export * from './vod_player';
20
25
  declare class TRTCCloud extends EventEmitter {
21
26
  private logger;
22
27
  private id;
28
+ private static isIPCMode;
23
29
  private static sharedTRTCCloudInstance;
24
30
  private static subInstances;
31
+ private stateStore;
25
32
  private rtcCloud;
26
33
  private videoRendererMap;
27
34
  private localFillMode;
@@ -55,6 +62,12 @@ declare class TRTCCloud extends EventEmitter {
55
62
  private playAudioEffectIdList;
56
63
  private remoteVideoBufferMap;
57
64
  private localVideoBufferMap;
65
+ /**
66
+ * 构造函数
67
+ * @param config {TRTCInitConfig} - 初始化参数,可选
68
+ * @param config.networkProxy {Record<string, any>} - 网络代理参数,可选。为空时,默认不开启网络代理。
69
+ * @param config.isIPCMode {Boolean} - 是否跨进程模式,跨进程模式支持本地混流且混流视频采用原生窗口渲染。默认:false,不开启。
70
+ */
58
71
  constructor(config?: TRTCInitConfig);
59
72
  /**
60
73
  * 创建 TRTCCloud 主实例对象(单例模式)
@@ -628,7 +641,11 @@ declare class TRTCCloud extends EventEmitter {
628
641
  * 当您调用 [stopLocalRecording]{@link TRTCCloud#stopLocalRecording} 停止本地媒体录制任务时,SDK 会抛出该事件回调,用于通知您录制任务的最终结果。
629
642
  *
630
643
  * @event TRTCCallback#onLocalRecordComplete
631
- * @param {number} errCode - 错误码 0:录制成功;-1:录制失败;-2:切换分辨率或横竖屏导致录制结束。
644
+ * @param {number} errCode - 错误码
645
+ * - 0:录制成功;
646
+ * - -1:录制失败;
647
+ * - -2:切换分辨率或横竖屏导致录制结束;
648
+ * - -3:录制时间太短,或未采集到任何视频或音频数据,请检查录制时长,或是否已开启音、视频采集。
632
649
  * @param {string} storagePath - 录制文件存储路径
633
650
  */
634
651
  handleOnLocalRecordComplete(errCode: number, storagePath: string): void;
@@ -1361,9 +1378,9 @@ declare class TRTCCloud extends EventEmitter {
1361
1378
  * var camera = cameralist[i];
1362
1379
  * console.info("camera deviceName: " + camera.deviceName + " deviceId:" + camera.deviceId);
1363
1380
  * }
1364
- * @return {TRTCDeviceInfo[]} 摄像头管理器列表
1381
+ * @return {Array<TRTCDeviceInfo>} 摄像头管理器列表
1365
1382
  */
1366
- getCameraDevicesList(): TRTCDeviceInfo[];
1383
+ getCameraDevicesList(): Array<TRTCDeviceInfo>;
1367
1384
  /**
1368
1385
  * 设置要使用的摄像头
1369
1386
  *
@@ -1375,7 +1392,7 @@ declare class TRTCCloud extends EventEmitter {
1375
1392
  *
1376
1393
  * @return {TRTCDeviceInfo} 设备信息,能获取设备 ID 和设备名称
1377
1394
  */
1378
- getCurrentCameraDevice(): any;
1395
+ getCurrentCameraDevice(): TRTCDeviceInfo;
1379
1396
  /**
1380
1397
  * 获取麦克风设备列表
1381
1398
  *
@@ -1385,15 +1402,15 @@ declare class TRTCCloud extends EventEmitter {
1385
1402
  * var mic = miclist[i];
1386
1403
  * console.info("mic deviceName: " + mic.deviceName + " deviceId:" + mic.deviceId);
1387
1404
  * }
1388
- * @return {TRTCDeviceInfo[]} 麦克风管理器列表
1405
+ * @return {Array<TRTCDeviceInfo>} 麦克风管理器列表
1389
1406
  */
1390
- getMicDevicesList(): any;
1407
+ getMicDevicesList(): Array<TRTCDeviceInfo>;
1391
1408
  /**
1392
1409
  * 获取当前选择的麦克风
1393
1410
  *
1394
1411
  * @return {TRTCDeviceInfo} 设备信息,能获取设备 ID 和设备名称
1395
1412
  */
1396
- getCurrentMicDevice(): any;
1413
+ getCurrentMicDevice(): TRTCDeviceInfo;
1397
1414
  /**
1398
1415
  * 设置要使用的麦克风
1399
1416
  *
@@ -1408,7 +1425,7 @@ declare class TRTCCloud extends EventEmitter {
1408
1425
  * 注意:查询的是系统硬件音量大小。
1409
1426
  * @return {Number} 音量值,范围是0 - 100
1410
1427
  */
1411
- getCurrentMicDeviceVolume(): any;
1428
+ getCurrentMicDeviceVolume(): number;
1412
1429
  /**
1413
1430
  * 设置系统当前麦克风设备的音量
1414
1431
  *
@@ -1427,7 +1444,7 @@ declare class TRTCCloud extends EventEmitter {
1427
1444
  *
1428
1445
  * @return {Boolean} 静音状态
1429
1446
  */
1430
- getCurrentMicDeviceMute(): any;
1447
+ getCurrentMicDeviceMute(): boolean;
1431
1448
  /**
1432
1449
  * 获取扬声器设备列表
1433
1450
  *
@@ -1437,15 +1454,15 @@ declare class TRTCCloud extends EventEmitter {
1437
1454
  * var speaker = speakerlist[i];
1438
1455
  * console.info("mic deviceName: " + speaker.deviceName + " deviceId:" + speaker.deviceId);
1439
1456
  * }
1440
- * @return {TRTCDeviceInfo[]} 扬声器管理器列表
1457
+ * @return {Array<TRTCDeviceInfo>} 扬声器管理器列表
1441
1458
  */
1442
- getSpeakerDevicesList(): any;
1459
+ getSpeakerDevicesList(): Array<TRTCDeviceInfo>;
1443
1460
  /**
1444
1461
  * 获取当前的扬声器设备
1445
1462
  *
1446
1463
  * @return {TRTCDeviceInfo} 设备信息,能获取设备 ID 和设备名称
1447
1464
  */
1448
- getCurrentSpeakerDevice(): any;
1465
+ getCurrentSpeakerDevice(): TRTCDeviceInfo;
1449
1466
  /**
1450
1467
  * 设置要使用的扬声器
1451
1468
  *
@@ -1457,7 +1474,7 @@ declare class TRTCCloud extends EventEmitter {
1457
1474
  *
1458
1475
  * @return {Number} 扬声器音量,范围0 - 100
1459
1476
  */
1460
- getCurrentSpeakerVolume(): any;
1477
+ getCurrentSpeakerVolume(): number;
1461
1478
  /**
1462
1479
  * 设置系统当前扬声器设备音量
1463
1480
  *
@@ -1477,7 +1494,7 @@ declare class TRTCCloud extends EventEmitter {
1477
1494
  *
1478
1495
  * @return {Boolean} 静音状态
1479
1496
  */
1480
- getCurrentSpeakerDeviceMute(): any;
1497
+ getCurrentSpeakerDeviceMute(): boolean;
1481
1498
  /**
1482
1499
  * 设置 SDK 使用的音频设备自动跟随系统默认设备
1483
1500
  *
@@ -2046,7 +2063,7 @@ declare class TRTCCloud extends EventEmitter {
2046
2063
  * @param {String} path - 音乐文件路径
2047
2064
  * @return {Number} 成功返回时长,失败返回-1
2048
2065
  */
2049
- getBGMDuration(path: string): any;
2066
+ getBGMDuration(path: string): number;
2050
2067
  /**
2051
2068
  * 废弃接口: 设置背景音乐播放进度
2052
2069
  *
@@ -2146,7 +2163,7 @@ declare class TRTCCloud extends EventEmitter {
2146
2163
  /**
2147
2164
  * 停止播放背景音乐
2148
2165
  *
2149
- * @param {Number} id 音乐 ID
2166
+ * @param {Number} id - 音乐 ID
2150
2167
  */
2151
2168
  stopPlayMusic(id: number): void;
2152
2169
  /**
@@ -2161,20 +2178,27 @@ declare class TRTCCloud extends EventEmitter {
2161
2178
  * @param {Number} id 音乐 ID
2162
2179
  */
2163
2180
  resumePlayMusic(id: number): void;
2181
+ /**
2182
+ * 获取背景音乐的播放进度(单位:毫秒)
2183
+ *
2184
+ * @param {Number} id - 音乐 ID。
2185
+ * @return {Promise<number>|Number} 成功返回当前播放时间,单位:毫秒,失败返回 -1。
2186
+ */
2187
+ getMusicCurrentPosInMS(id: number): Promise<number> | number;
2164
2188
  /**
2165
2189
  * 获取背景音乐文件总时长,单位毫秒
2166
2190
  *
2167
2191
  * @param {String} path - 音乐文件路径
2168
2192
  * @return {Number} 成功返回时长,失败返回-1
2169
2193
  */
2170
- getMusicDurationInMS(path: string): any;
2194
+ getMusicDurationInMS(path: string): number;
2171
2195
  /**
2172
2196
  * 设置背景音乐播放进度
2173
2197
  *
2174
2198
  * @param {Number} id - 音乐 ID
2175
2199
  * @param {Number} pts - 单位: 毫秒
2176
2200
  */
2177
- seekMusicToPosInTime(id: number, pts: number): any;
2201
+ seekMusicToPosInTime(id: number, pts: number): void;
2178
2202
  /**
2179
2203
  * 设置所有背景音乐的本地音量和远端音量的大小
2180
2204
  *
@@ -2186,7 +2210,7 @@ declare class TRTCCloud extends EventEmitter {
2186
2210
  *
2187
2211
  * @param {Number} volume - 音量大小,100为正常音量,取值范围为0 - 200。
2188
2212
  */
2189
- setAllMusicVolume(volume: number): any;
2213
+ setAllMusicVolume(volume: number): void;
2190
2214
  /**
2191
2215
  * 设置背景音乐本地播放音量的大小
2192
2216
  *
@@ -2396,7 +2420,7 @@ declare class TRTCCloud extends EventEmitter {
2396
2420
  *
2397
2421
  * @return {String} UTF-8 编码的版本号。
2398
2422
  */
2399
- getSDKVersion(): any;
2423
+ getSDKVersion(): string;
2400
2424
  /**
2401
2425
  * 设置 Log 输出级别
2402
2426
  *
@@ -2478,9 +2502,6 @@ declare class TRTCCloud extends EventEmitter {
2478
2502
  * @param config {TRTCVideoProcessPluginOptions | TRTCMediaEncryptDecryptPluginOptions | TRTCAudioProcessPluginOptions} - 插件配置参数
2479
2503
  */
2480
2504
  setPluginParams(type: TRTCPluginType, options: TRTCVideoProcessPluginOptions | TRTCMediaEncryptDecryptPluginOptions | TRTCAudioProcessPluginOptions): void;
2481
- private _setVideoProcessPluginParams;
2482
- private _setMediaEncryptDecryptPluginParams;
2483
- private _setAudioProcessPluginParams;
2484
2505
  /**
2485
2506
  * 添加插件
2486
2507
  *
@@ -2507,10 +2528,9 @@ declare class TRTCCloud extends EventEmitter {
2507
2528
  * @param [deviceId] {String} - 摄像头设备 ID,开启多个摄像头美颜时必填。
2508
2529
  */
2509
2530
  removePlugin(id: string, deviceId?: string): void;
2510
- private _createPlugin;
2511
2531
  /**
2512
2532
  * 注册插件事件监听,全局只需要调用一次
2513
- * @param {Function} pluginCb - 插件事件回调函数
2533
+ * @param {Function} pluginCallback - 插件事件回调函数
2514
2534
  * - pluginId - 插件ID
2515
2535
  * - errorCode - 错误码。0、-1、-2、-3、-4、-5 是 SDK 内部定义错误码,其它错误码是插件自定义错误码。
2516
2536
  * - 0 表示 addPlugin 成功
@@ -2523,7 +2543,7 @@ declare class TRTCCloud extends EventEmitter {
2523
2543
  *
2524
2544
  * 注意:错误码:-1000 到 1000 是 SDK 预留错误码,用户自定义插件中,请使用这个范围以外的错误码。
2525
2545
  */
2526
- setPluginCallback(pluginCb: (pluginId: string, errorCode: number, msg: string) => void): void;
2546
+ setPluginCallback(pluginCallback: (pluginId: string, errorCode: number, msg: string) => void): void;
2527
2547
  /**
2528
2548
  * 初始化插件管理器
2529
2549
  *
@@ -2550,14 +2570,15 @@ declare class TRTCCloud extends EventEmitter {
2550
2570
  destroyPluginManager(): void;
2551
2571
  /**
2552
2572
  * 获取插件列表
2553
- * @returns TRTCPluginInfo[]
2573
+ * @returns TRTCPluginInfo[]|null
2554
2574
  *
2555
2575
  * @ignore
2556
2576
  * @deprecated
2557
2577
  */
2558
- getPluginList(): TRTCPluginInfo[];
2578
+ getPluginList(): TRTCPluginInfo[] | null;
2559
2579
  private _getKey;
2560
2580
  setEnableRenderFrame(enable: boolean): void;
2581
+ log(info: string): void;
2561
2582
  private _getRendererMap;
2562
2583
  private _onRenderFrame;
2563
2584
  private _onRealRender;
@@ -2583,6 +2604,30 @@ declare class TRTCCloud extends EventEmitter {
2583
2604
  private _RGBA2BGRA;
2584
2605
  private _isMacPlatform;
2585
2606
  private _setRemoteVideoBuffer;
2607
+ /**
2608
+ * 获取设备管理器
2609
+ *
2610
+ * @returns {TRTCDeviceManager}
2611
+ */
2612
+ private getDeviceManager;
2613
+ /**
2614
+ * 获取音效管理器
2615
+ *
2616
+ * @returns {TRTCAudioEffectManager}
2617
+ */
2618
+ private getAudioEffectManager;
2619
+ /**
2620
+ * 获取本地混流管理器
2621
+ *
2622
+ * @returns {TRTCMediaMixingManager | null}
2623
+ */
2624
+ getMediaMixingManager(): TRTCMediaMixingManager | null;
2625
+ /**
2626
+ * 获取插件管理器
2627
+ *
2628
+ * @returns {TRTCPluginManager}
2629
+ */
2630
+ private getPluginManager;
2586
2631
  }
2587
2632
  export default TRTCCloud;
2588
2633
  export * from './LocalMediaTranscoder';