trtc-electron-sdk 9.3.201 → 9.3.301
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 +68 -108
- package/liteav/trtc.js +453 -560
- package/liteav/trtc_define.d.ts +12 -84
- package/liteav/trtc_define.js +12 -122
- package/package.json +1 -1
package/liteav/trtc_define.d.ts
CHANGED
|
@@ -141,28 +141,6 @@ export declare class TRTCScreenCaptureSourceInfo {
|
|
|
141
141
|
isMinimizeWindow: boolean;
|
|
142
142
|
constructor(type?: TRTCScreenCaptureSourceType, sourceId?: string, sourceName?: string, thumbBGRA?: TRTCImageBuffer, iconBGRA?: TRTCImageBuffer, isMinimizeWindow?: boolean);
|
|
143
143
|
}
|
|
144
|
-
/**
|
|
145
|
-
* 3.6 屏幕分享的进阶控制参数
|
|
146
|
-
*
|
|
147
|
-
* 该参数用于屏幕分享相关的接口 [selectScreenCaptureTarget]{@link TRTCCloud#selectScreenCaptureTarget},用于在指定分享目标时设定一系列进阶控制参数。
|
|
148
|
-
* 比如:是否采集鼠标、是否要采集子窗口、是否要在被分享目标周围绘制一个边框等。
|
|
149
|
-
*
|
|
150
|
-
* @param {Boolean} enableCaptureMouse - 是否采集目标内容的同时采集鼠标,默认为 true
|
|
151
|
-
* @param {Boolean} enableHighLight - 是否高亮正在共享的窗口(在被分享目标周围绘制一个边框),默认为 true。
|
|
152
|
-
* @param {Boolean} enableHighPerformance - 是否开启高性能模式(只会在分享屏幕时会生效),默认为 true。【特殊说明】开启后屏幕采集性能最佳,但会丧失抗遮挡能力,如果您同时开启 enableHighLight + enableHighPerformance,远端用户可以看到高亮的边框。
|
|
153
|
-
* @param {Number} highLightColor - 指定高亮边框的颜色,RGB 格式,传入 0 时代表采用默认颜色,默认颜色为 #8CBF26。
|
|
154
|
-
* @param {Number} highLightWidth - 指定高亮边框的宽度,传入0时采用默认描边宽度,默认宽度为 5px,您可以设置的最大值为 50。
|
|
155
|
-
* @param {Boolean} enableCaptureChildWindow - 窗口采集时是否采集子窗口(需要子窗口与被采集窗口具有 Owner 或 Popup 属性),默认为 false。
|
|
156
|
-
*/
|
|
157
|
-
export declare class TRTCScreenCaptureProperty {
|
|
158
|
-
enableCaptureMouse: boolean;
|
|
159
|
-
enableHighLight: boolean;
|
|
160
|
-
enableHighPerformance: boolean;
|
|
161
|
-
highLightColor: number;
|
|
162
|
-
highLightWidth: number;
|
|
163
|
-
enableCaptureChildWindow: boolean;
|
|
164
|
-
constructor(enableCaptureMouse?: boolean, enableHighLight?: boolean, enableHighPerformance?: boolean, highLightColor?: number, highLightWidth?: number, enableCaptureChildWindow?: boolean);
|
|
165
|
-
}
|
|
166
144
|
/**
|
|
167
145
|
* 3.6 设备信息
|
|
168
146
|
*
|
|
@@ -379,25 +357,6 @@ export declare class TRTCVolumeInfo {
|
|
|
379
357
|
volume: number;
|
|
380
358
|
constructor(userId?: string, volume?: number);
|
|
381
359
|
}
|
|
382
|
-
/**
|
|
383
|
-
* 5.7 测速参数
|
|
384
|
-
*
|
|
385
|
-
* 您可以在用户进入房间前通过 [startSpeedTest]{@link TRTCCloud#startSpeedTest} 接口测试网速(注意:请不要在通话中调用)。
|
|
386
|
-
*
|
|
387
|
-
* @param {Number} sdkAppId - 应用标识
|
|
388
|
-
* @param {String} userId - 用户标识
|
|
389
|
-
* @param {String} userSig - 用户签名
|
|
390
|
-
* @param {Number} expectedUpBandwidth - 预期的上行带宽(kbps,取值范围: 10 ~ 5000,为 0 时不测试)。
|
|
391
|
-
* @param {Number} expectedDownBandwidth - 预期的下行带宽(kbps,取值范围: 10 ~ 5000,为 0 时不测试)。
|
|
392
|
-
*/
|
|
393
|
-
export declare class TRTCSpeedTestParams {
|
|
394
|
-
sdkAppId: number;
|
|
395
|
-
userId: string;
|
|
396
|
-
userSig: string;
|
|
397
|
-
expectedUpBandwidth: number;
|
|
398
|
-
expectedDownBandwidth: number;
|
|
399
|
-
constructor(sdkAppId?: number, userId?: string, userSig?: string, expectedUpBandwidth?: number, expectedDownBandwidth?: number);
|
|
400
|
-
}
|
|
401
360
|
/**
|
|
402
361
|
* 5.8 网络测速结果
|
|
403
362
|
*
|
|
@@ -410,28 +369,20 @@ export declare class TRTCSpeedTestParams {
|
|
|
410
369
|
* - downLostRate 是指下行丢包率,例如0.2代表从服务器每收取10个数据包,可能有2个会在中途丢失。
|
|
411
370
|
* - rtt 是指当前设备到腾讯云服务器的一次网络往返时间,正常数值在10ms - 100ms之间。
|
|
412
371
|
*
|
|
413
|
-
* @param {Boolean} success - 测试是否成功, 9.3 版本新增字段
|
|
414
|
-
* @param {String} errMsg - 带宽测试错误信息, 9.3 版本新增字段
|
|
415
372
|
* @param {String} ip - 服务器 IP 地址
|
|
416
373
|
* @param {TRTCQuality} quality - 网络质量,内部通过评估算法测算出的网络质量,loss 越低,rtt 越小,得分也就越高
|
|
417
374
|
* @param {Number} upLostRate - 上行丢包率,范围是[0 - 1.0],例如0.3代表每向服务器发送10个数据包,可能有3个会在中途丢失。
|
|
418
375
|
* @param {Number} downLostRate - 下行丢包率,范围是[0 - 1.0],例如0.2代表从服务器每收取10个数据包,可能有2个会在中途丢失。
|
|
419
376
|
* @param {Number} rtt - 延迟(毫秒),代表 SDK 跟服务器一来一回之间所消耗的时间,这个值越小越好,正常数值在10ms - 100ms之间。
|
|
420
|
-
* @param {Number} availableUpBandwidth - 上行带宽(kbps,-1:无效值)。
|
|
421
|
-
* @param {Number} availableDownBandwidth - 下行带宽(kbps,-1:无效值)。
|
|
422
377
|
*
|
|
423
378
|
*/
|
|
424
379
|
export declare class TRTCSpeedTestResult {
|
|
425
|
-
success: boolean;
|
|
426
|
-
errMsg: string;
|
|
427
380
|
ip: string;
|
|
428
381
|
quality: TRTCQuality;
|
|
429
382
|
upLostRate: number;
|
|
430
383
|
downLostRate: number;
|
|
431
384
|
rtt: number;
|
|
432
|
-
|
|
433
|
-
availableDownBandwidth: number;
|
|
434
|
-
constructor(success?: boolean, errMsg?: string, ip?: string, quality?: TRTCQuality, upLostRate?: number, downLostRate?: number, rtt?: number, availableUpBandwidth?: number, availableDownBandwidth?: number);
|
|
385
|
+
constructor(ip?: string, quality?: TRTCQuality, upLostRate?: number, downLostRate?: number, rtt?: number);
|
|
435
386
|
}
|
|
436
387
|
/**
|
|
437
388
|
* 记录矩形的四个点坐标
|
|
@@ -464,10 +415,6 @@ export declare class Rect {
|
|
|
464
415
|
* @param {Number} zOrder - 图层层次(1 - 15)不可重复
|
|
465
416
|
* @param {Boolean} pureAudio - 是否纯音频
|
|
466
417
|
* @param {TRTCVideoStreamType} streamType - 参与混合的是主路画面(TRTCVideoStreamTypeBig)或屏幕分享(TRTCVideoStreamTypeSub)画面
|
|
467
|
-
* @param {TRTCMixInputType} inputType - 指定该路流的混合内容(只混合音频、只混合视频、混合音频和视频),该字段是对 pureAudio 字段的升级。
|
|
468
|
-
* 默认值:TRTCMixInputTypeUndefined,代表参考 pureAudio 的取值。
|
|
469
|
-
* 如果您是第一次使用 TRTC,之前并没有对 pureAudio 字段进行过设置,您可以根据实际需要设置该字段,不建议您再设置 pureAudio。
|
|
470
|
-
* 如果您之前在老版本中已经使用了 pureAudio 字段,并期望保持其设置,则可以将 inputType 设置为 TRTCMixInputTypeUndefined。
|
|
471
418
|
*
|
|
472
419
|
*/
|
|
473
420
|
export declare class TRTCMixUser {
|
|
@@ -477,8 +424,7 @@ export declare class TRTCMixUser {
|
|
|
477
424
|
zOrder: number;
|
|
478
425
|
pureAudio: boolean;
|
|
479
426
|
streamType: TRTCVideoStreamType;
|
|
480
|
-
|
|
481
|
-
constructor(userId?: string, roomId?: string, rect?: null | Rect, zOrder?: number, pureAudio?: boolean, streamType?: TRTCVideoStreamType, inputType?: TRTCMixInputType);
|
|
427
|
+
constructor(userId?: string, roomId?: string, rect?: null | Rect, zOrder?: number, pureAudio?: boolean, streamType?: TRTCVideoStreamType);
|
|
482
428
|
}
|
|
483
429
|
export declare enum TRTCTranscodingConfigMode {
|
|
484
430
|
TRTCTranscodingConfigMode_Unknown = 0,
|
|
@@ -492,19 +438,8 @@ export declare enum TRTCTranscodingConfigMode {
|
|
|
492
438
|
TRTC_TranscodingConfigMode_Template_PresetLayout = 8,
|
|
493
439
|
TRTC_TranscodingConfigMode_Template_ScreenSharing = 9
|
|
494
440
|
}
|
|
495
|
-
export declare enum TRTCMixInputType {
|
|
496
|
-
TRTCMixInputTypeUndefined = 0,
|
|
497
|
-
TRTCMixInputTypeAudioVideo = 1,
|
|
498
|
-
TRTCMixInputTypePureVideo = 2,
|
|
499
|
-
TRTCMixInputTypePureAudio = 3
|
|
500
|
-
}
|
|
501
|
-
export declare enum TRTCAudioRecordingContent {
|
|
502
|
-
TRTCAudioRecordingContentAll = 0,
|
|
503
|
-
TRTCAudioRecordingContentLocal = 1,
|
|
504
|
-
TRTCAudioRecordingContentRemote = 2
|
|
505
|
-
}
|
|
506
441
|
/**
|
|
507
|
-
* 5.
|
|
442
|
+
* 5.11 云端混流(转码)配置
|
|
508
443
|
*
|
|
509
444
|
* 包括最终编码质量和各路画面的摆放位置
|
|
510
445
|
*
|
|
@@ -557,12 +492,11 @@ export declare class TRTCTranscodingConfig {
|
|
|
557
492
|
audioBitrate: number;
|
|
558
493
|
audioChannels: number;
|
|
559
494
|
mixUsersArray: TRTCMixUser[];
|
|
560
|
-
mixUsersArraySize: number;
|
|
561
495
|
streamId: string;
|
|
562
496
|
constructor(mode?: TRTCTranscodingConfigMode, appId?: number, bizId?: number, videoWidth?: number, videoHeight?: number, videoBitrate?: number, videoFramerate?: number, videoGOP?: number, backgroundColor?: number, backgroundImage?: string, audioSampleRate?: number, audioBitrate?: number, audioChannels?: number, mixUsersArray?: any[], streamId?: string);
|
|
563
497
|
}
|
|
564
498
|
/**
|
|
565
|
-
* 5.
|
|
499
|
+
* 5.12 CDN 旁路推流参数
|
|
566
500
|
*
|
|
567
501
|
* @param {Number} appId - 腾讯云 AppID,请在 [实时音视频控制台](https://console.cloud.tencent.com/rav) 选择已经创建的应用,单击【帐号信息】后,在“直播信息”中获取
|
|
568
502
|
* @param {Number} bizId - 腾讯云直播 bizId,请在 [实时音视频控制台](https://console.cloud.tencent.com/rav) 选择已经创建的应用,单击【帐号信息】后,在“直播信息”中获取
|
|
@@ -576,22 +510,20 @@ export declare class TRTCPublishCDNParam {
|
|
|
576
510
|
constructor(appId?: number, bizId?: number, url?: null | string);
|
|
577
511
|
}
|
|
578
512
|
/**
|
|
579
|
-
* 5.
|
|
513
|
+
* 5.13 录音参数
|
|
580
514
|
*
|
|
581
515
|
* 请正确填写参数,确保录音文件顺利生成。
|
|
582
516
|
*
|
|
583
|
-
* @param {String} filePath
|
|
584
|
-
*
|
|
585
|
-
*
|
|
586
|
-
* 【特别说明】默认录制所有本地和远端音频。
|
|
517
|
+
* @param {String} filePath - 【字段含义】文件路径(必填),录音文件的保存路径。该路径需要用户自行指定,请确保路径存在且可写。<br>
|
|
518
|
+
* 【特别说明】该路径需精确到文件名及格式后缀,格式后缀决定录制文件的格式,例如:指定路径为 path/to/audio.aac,则会生成一个 AAC 格式的文件。目前支持的格式有 PCM, WAV, AAC
|
|
519
|
+
*
|
|
587
520
|
*/
|
|
588
521
|
export declare class TRTCAudioRecordingParams {
|
|
589
522
|
filePath: null | string;
|
|
590
|
-
|
|
591
|
-
constructor(filePath?: null | string, recordingContent?: TRTCAudioRecordingContent);
|
|
523
|
+
constructor(filePath?: null | string);
|
|
592
524
|
}
|
|
593
525
|
/**
|
|
594
|
-
* 5.
|
|
526
|
+
* 5.14 音效
|
|
595
527
|
*
|
|
596
528
|
* @param {Number} effectId - 【字段含义】音效 ID<br>
|
|
597
529
|
* 【特殊说明】SDK 允许播放多路音效,因此需要音效 ID 进行标记,用于控制音效的开始、停止、音量等
|
|
@@ -684,9 +616,6 @@ export declare class TRTCRemoteStatistics {
|
|
|
684
616
|
* @param {Number} rtt - 延迟(毫秒),代表 SDK 跟服务器一来一回之间所消耗的时间,这个值越小越好。
|
|
685
617
|
* 一般低于50ms的 rtt 是比较理想的情况,而高于100ms的 rtt 会引入较大的通话延时。
|
|
686
618
|
* 由于数据上下行共享一条网络连接,所以 local 和 remote 的 rtt 相同。
|
|
687
|
-
* @param {Number} gatewayRtt - 延迟(毫秒),指 SDK 到本地路由器网关一次网络往返时间,该值越小越好。
|
|
688
|
-
* 一般低于 50ms 的 gatewayRtt 相对理想,而高于 200ms 的 gatewayRtt 会引入较大的通话延时。
|
|
689
|
-
* 当网络为蜂窝网非 WiFi 类型时,该值无效。
|
|
690
619
|
* @param {Number} receivedBytes - 总接收字节数(包含信令和音视频)
|
|
691
620
|
* @param {Number} sentBytes - 总发送字节总数(包含信令和音视频)
|
|
692
621
|
* @param {TRTCLocalStatistics[]} localStatisticsArray - 自己本地的音视频统计信息,由于可能有大画面、小画面以及辅路画面等多路的情况,所以是一个数组
|
|
@@ -701,14 +630,13 @@ export declare class TRTCStatistics {
|
|
|
701
630
|
appCpu: number;
|
|
702
631
|
systemCpu: number;
|
|
703
632
|
rtt: number;
|
|
704
|
-
gatewayRtt: number;
|
|
705
633
|
receivedBytes: number;
|
|
706
634
|
sentBytes: number;
|
|
707
635
|
localStatisticsArray: TRTCLocalStatistics[];
|
|
708
636
|
localStatisticsArraySize: number;
|
|
709
637
|
remoteStatisticsArray: TRTCRemoteStatistics[];
|
|
710
638
|
remoteStatisticsArraySize: number;
|
|
711
|
-
constructor(upLoss?: number, downLoss?: number, appCpu?: number, systemCpu?: number, rtt?: number,
|
|
639
|
+
constructor(upLoss?: number, downLoss?: number, appCpu?: number, systemCpu?: number, rtt?: number, receivedBytes?: number, sentBytes?: number, localStatisticsArray?: TRTCLocalStatistics[], localStatisticsArraySize?: number, remoteStatisticsArray?: TRTCRemoteStatistics[], remoteStatisticsArraySize?: number);
|
|
712
640
|
}
|
|
713
641
|
/**
|
|
714
642
|
* 音乐参数
|
|
@@ -765,5 +693,5 @@ export interface PluginInfo {
|
|
|
765
693
|
enable: () => number;
|
|
766
694
|
disable: () => number;
|
|
767
695
|
setParameter: (param: string) => number;
|
|
768
|
-
getParameter: () => string;
|
|
696
|
+
getParameter: (paramKey: string) => string;
|
|
769
697
|
}
|
package/liteav/trtc_define.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.TRTCSwitchRoomParam = exports.AudioMusicParam = exports.TRTCStatistics = exports.TRTCRemoteStatistics = exports.TRTCLocalStatistics = exports.TRTCAudioEffectParam = exports.TRTCAudioRecordingParams = exports.TRTCPublishCDNParam = exports.TRTCTranscodingConfig = exports.
|
|
9
|
+
exports.TRTCSwitchRoomParam = exports.AudioMusicParam = exports.TRTCStatistics = exports.TRTCRemoteStatistics = exports.TRTCLocalStatistics = exports.TRTCAudioEffectParam = exports.TRTCAudioRecordingParams = exports.TRTCPublishCDNParam = exports.TRTCTranscodingConfig = exports.TRTCTranscodingConfigMode = exports.TRTCMixUser = exports.Rect = exports.TRTCSpeedTestResult = exports.TRTCVolumeInfo = exports.TRTCQualityInfo = exports.TRTCNetworkQosParam = exports.TRTCRenderParams = exports.TRTCVideoEncParam = exports.TRTCParams = exports.TRTCWaterMarkSrcType = exports.TRTCDeviceType = exports.TRTCDeviceState = exports.TRTCLogLevel = exports.TRTCVideoFrame = exports.TRTCDeviceInfo = exports.TRTCScreenCaptureSourceInfo = exports.TRTCImageBuffer = exports.TRTCAudioQuality = exports.TRTCScreenCaptureSourceType = exports.TRTCAudioFrameFormat = exports.TRTCVideoQosPreference = exports.TRTCQosControlMode = exports.TRTCRoleType = exports.TRTCAppScene = exports.TRTCVideoMirrorType = exports.TRTCVideoBufferType = exports.TRTCVideoPixelFormat = exports.TRTCBeautyStyle = exports.TRTCVideoRotation = exports.TRTCVideoFillMode = exports.TRTCQuality = exports.TRTCVideoStreamType = exports.TRTCVideoResolutionMode = exports.TRTCVideoResolution = void 0;
|
|
10
10
|
/////////////////////////////////////////////////////////////////////////////////
|
|
11
11
|
//
|
|
12
12
|
// 【(一)视频相关枚举值定义】
|
|
@@ -538,30 +538,6 @@ class TRTCScreenCaptureSourceInfo {
|
|
|
538
538
|
}
|
|
539
539
|
exports.TRTCScreenCaptureSourceInfo = TRTCScreenCaptureSourceInfo;
|
|
540
540
|
;
|
|
541
|
-
/**
|
|
542
|
-
* 3.6 屏幕分享的进阶控制参数
|
|
543
|
-
*
|
|
544
|
-
* 该参数用于屏幕分享相关的接口 [selectScreenCaptureTarget]{@link TRTCCloud#selectScreenCaptureTarget},用于在指定分享目标时设定一系列进阶控制参数。
|
|
545
|
-
* 比如:是否采集鼠标、是否要采集子窗口、是否要在被分享目标周围绘制一个边框等。
|
|
546
|
-
*
|
|
547
|
-
* @param {Boolean} enableCaptureMouse - 是否采集目标内容的同时采集鼠标,默认为 true
|
|
548
|
-
* @param {Boolean} enableHighLight - 是否高亮正在共享的窗口(在被分享目标周围绘制一个边框),默认为 true。
|
|
549
|
-
* @param {Boolean} enableHighPerformance - 是否开启高性能模式(只会在分享屏幕时会生效),默认为 true。【特殊说明】开启后屏幕采集性能最佳,但会丧失抗遮挡能力,如果您同时开启 enableHighLight + enableHighPerformance,远端用户可以看到高亮的边框。
|
|
550
|
-
* @param {Number} highLightColor - 指定高亮边框的颜色,RGB 格式,传入 0 时代表采用默认颜色,默认颜色为 #8CBF26。
|
|
551
|
-
* @param {Number} highLightWidth - 指定高亮边框的宽度,传入0时采用默认描边宽度,默认宽度为 5px,您可以设置的最大值为 50。
|
|
552
|
-
* @param {Boolean} enableCaptureChildWindow - 窗口采集时是否采集子窗口(需要子窗口与被采集窗口具有 Owner 或 Popup 属性),默认为 false。
|
|
553
|
-
*/
|
|
554
|
-
class TRTCScreenCaptureProperty {
|
|
555
|
-
constructor(enableCaptureMouse = true, enableHighLight = true, enableHighPerformance = true, highLightColor = 0, highLightWidth = 0, enableCaptureChildWindow = false) {
|
|
556
|
-
this.enableCaptureMouse = enableCaptureMouse;
|
|
557
|
-
this.enableHighLight = enableHighLight;
|
|
558
|
-
this.enableHighPerformance = enableHighPerformance;
|
|
559
|
-
this.highLightColor = highLightColor;
|
|
560
|
-
this.highLightWidth = highLightWidth;
|
|
561
|
-
this.enableCaptureChildWindow = enableCaptureChildWindow;
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
exports.TRTCScreenCaptureProperty = TRTCScreenCaptureProperty;
|
|
565
541
|
/**
|
|
566
542
|
* 3.6 设备信息
|
|
567
543
|
*
|
|
@@ -885,27 +861,6 @@ class TRTCVolumeInfo {
|
|
|
885
861
|
}
|
|
886
862
|
exports.TRTCVolumeInfo = TRTCVolumeInfo;
|
|
887
863
|
;
|
|
888
|
-
/**
|
|
889
|
-
* 5.7 测速参数
|
|
890
|
-
*
|
|
891
|
-
* 您可以在用户进入房间前通过 [startSpeedTest]{@link TRTCCloud#startSpeedTest} 接口测试网速(注意:请不要在通话中调用)。
|
|
892
|
-
*
|
|
893
|
-
* @param {Number} sdkAppId - 应用标识
|
|
894
|
-
* @param {String} userId - 用户标识
|
|
895
|
-
* @param {String} userSig - 用户签名
|
|
896
|
-
* @param {Number} expectedUpBandwidth - 预期的上行带宽(kbps,取值范围: 10 ~ 5000,为 0 时不测试)。
|
|
897
|
-
* @param {Number} expectedDownBandwidth - 预期的下行带宽(kbps,取值范围: 10 ~ 5000,为 0 时不测试)。
|
|
898
|
-
*/
|
|
899
|
-
class TRTCSpeedTestParams {
|
|
900
|
-
constructor(sdkAppId = 0, userId = '', userSig = '', expectedUpBandwidth = 0, expectedDownBandwidth = 0) {
|
|
901
|
-
this.sdkAppId = sdkAppId;
|
|
902
|
-
this.userId = userId;
|
|
903
|
-
this.userSig = userSig;
|
|
904
|
-
this.expectedUpBandwidth = expectedUpBandwidth;
|
|
905
|
-
this.expectedDownBandwidth = expectedDownBandwidth;
|
|
906
|
-
}
|
|
907
|
-
}
|
|
908
|
-
exports.TRTCSpeedTestParams = TRTCSpeedTestParams;
|
|
909
864
|
/**
|
|
910
865
|
* 5.8 网络测速结果
|
|
911
866
|
*
|
|
@@ -918,28 +873,20 @@ exports.TRTCSpeedTestParams = TRTCSpeedTestParams;
|
|
|
918
873
|
* - downLostRate 是指下行丢包率,例如0.2代表从服务器每收取10个数据包,可能有2个会在中途丢失。
|
|
919
874
|
* - rtt 是指当前设备到腾讯云服务器的一次网络往返时间,正常数值在10ms - 100ms之间。
|
|
920
875
|
*
|
|
921
|
-
* @param {Boolean} success - 测试是否成功, 9.3 版本新增字段
|
|
922
|
-
* @param {String} errMsg - 带宽测试错误信息, 9.3 版本新增字段
|
|
923
876
|
* @param {String} ip - 服务器 IP 地址
|
|
924
877
|
* @param {TRTCQuality} quality - 网络质量,内部通过评估算法测算出的网络质量,loss 越低,rtt 越小,得分也就越高
|
|
925
878
|
* @param {Number} upLostRate - 上行丢包率,范围是[0 - 1.0],例如0.3代表每向服务器发送10个数据包,可能有3个会在中途丢失。
|
|
926
879
|
* @param {Number} downLostRate - 下行丢包率,范围是[0 - 1.0],例如0.2代表从服务器每收取10个数据包,可能有2个会在中途丢失。
|
|
927
880
|
* @param {Number} rtt - 延迟(毫秒),代表 SDK 跟服务器一来一回之间所消耗的时间,这个值越小越好,正常数值在10ms - 100ms之间。
|
|
928
|
-
* @param {Number} availableUpBandwidth - 上行带宽(kbps,-1:无效值)。
|
|
929
|
-
* @param {Number} availableDownBandwidth - 下行带宽(kbps,-1:无效值)。
|
|
930
881
|
*
|
|
931
882
|
*/
|
|
932
883
|
class TRTCSpeedTestResult {
|
|
933
|
-
constructor(
|
|
934
|
-
this.success = false;
|
|
935
|
-
this.errMsg = errMsg;
|
|
884
|
+
constructor(ip = '', quality = TRTCQuality.TRTCQuality_Unknown, upLostRate = 0.0, downLostRate = 0.0, rtt = 0) {
|
|
936
885
|
this.ip = ip;
|
|
937
886
|
this.quality = quality;
|
|
938
887
|
this.upLostRate = upLostRate;
|
|
939
888
|
this.downLostRate = downLostRate;
|
|
940
889
|
this.rtt = rtt;
|
|
941
|
-
this.availableUpBandwidth = availableUpBandwidth;
|
|
942
|
-
this.availableDownBandwidth = availableDownBandwidth;
|
|
943
890
|
}
|
|
944
891
|
}
|
|
945
892
|
exports.TRTCSpeedTestResult = TRTCSpeedTestResult;
|
|
@@ -978,21 +925,16 @@ exports.Rect = Rect;
|
|
|
978
925
|
* @param {Number} zOrder - 图层层次(1 - 15)不可重复
|
|
979
926
|
* @param {Boolean} pureAudio - 是否纯音频
|
|
980
927
|
* @param {TRTCVideoStreamType} streamType - 参与混合的是主路画面(TRTCVideoStreamTypeBig)或屏幕分享(TRTCVideoStreamTypeSub)画面
|
|
981
|
-
* @param {TRTCMixInputType} inputType - 指定该路流的混合内容(只混合音频、只混合视频、混合音频和视频),该字段是对 pureAudio 字段的升级。
|
|
982
|
-
* 默认值:TRTCMixInputTypeUndefined,代表参考 pureAudio 的取值。
|
|
983
|
-
* 如果您是第一次使用 TRTC,之前并没有对 pureAudio 字段进行过设置,您可以根据实际需要设置该字段,不建议您再设置 pureAudio。
|
|
984
|
-
* 如果您之前在老版本中已经使用了 pureAudio 字段,并期望保持其设置,则可以将 inputType 设置为 TRTCMixInputTypeUndefined。
|
|
985
928
|
*
|
|
986
929
|
*/
|
|
987
930
|
class TRTCMixUser {
|
|
988
|
-
constructor(userId = '', roomId = '', rect = null, zOrder = 0, pureAudio = false, streamType = TRTCVideoStreamType.TRTCVideoStreamTypeBig
|
|
931
|
+
constructor(userId = '', roomId = '', rect = null, zOrder = 0, pureAudio = false, streamType = TRTCVideoStreamType.TRTCVideoStreamTypeBig) {
|
|
989
932
|
this.userId = userId;
|
|
990
933
|
this.roomId = roomId;
|
|
991
934
|
this.rect = rect;
|
|
992
935
|
this.zOrder = zOrder;
|
|
993
936
|
this.pureAudio = pureAudio;
|
|
994
937
|
this.streamType = streamType;
|
|
995
|
-
this.inputType = inputType;
|
|
996
938
|
}
|
|
997
939
|
}
|
|
998
940
|
exports.TRTCMixUser = TRTCMixUser;
|
|
@@ -1057,52 +999,7 @@ var TRTCTranscodingConfigMode;
|
|
|
1057
999
|
})(TRTCTranscodingConfigMode = exports.TRTCTranscodingConfigMode || (exports.TRTCTranscodingConfigMode = {}));
|
|
1058
1000
|
;
|
|
1059
1001
|
/**
|
|
1060
|
-
* 5.11
|
|
1061
|
-
*
|
|
1062
|
-
* @enum {Number}
|
|
1063
|
-
*
|
|
1064
|
-
*/
|
|
1065
|
-
const TRTCMixInputType_HACK_JSDOC = {
|
|
1066
|
-
/** 不指定,SDK 会根据另一个参数 pureAudio 的数值决定混流输入类型 */
|
|
1067
|
-
TRTCMixInputTypeUndefined: 0,
|
|
1068
|
-
/** 混入音频和视频 */
|
|
1069
|
-
TRTCMixInputTypeAudioVideo: 1,
|
|
1070
|
-
/** 只混入视频 */
|
|
1071
|
-
TRTCMixInputTypePureVideo: 2,
|
|
1072
|
-
/** 只混入音频 */
|
|
1073
|
-
TRTCMixInputTypePureAudio: 3
|
|
1074
|
-
};
|
|
1075
|
-
var TRTCMixInputType;
|
|
1076
|
-
(function (TRTCMixInputType) {
|
|
1077
|
-
TRTCMixInputType[TRTCMixInputType["TRTCMixInputTypeUndefined"] = 0] = "TRTCMixInputTypeUndefined";
|
|
1078
|
-
TRTCMixInputType[TRTCMixInputType["TRTCMixInputTypeAudioVideo"] = 1] = "TRTCMixInputTypeAudioVideo";
|
|
1079
|
-
TRTCMixInputType[TRTCMixInputType["TRTCMixInputTypePureVideo"] = 2] = "TRTCMixInputTypePureVideo";
|
|
1080
|
-
TRTCMixInputType[TRTCMixInputType["TRTCMixInputTypePureAudio"] = 3] = "TRTCMixInputTypePureAudio";
|
|
1081
|
-
})(TRTCMixInputType = exports.TRTCMixInputType || (exports.TRTCMixInputType = {}));
|
|
1082
|
-
/**
|
|
1083
|
-
* 5.12 音频录制内容类型, 9.3 版本开始支持
|
|
1084
|
-
*
|
|
1085
|
-
* 该枚举类型用于音频录制接口 [startAudioRecording]{@link TRTCCloud#startAudioRecording},用于指定录制音频的内容。
|
|
1086
|
-
*
|
|
1087
|
-
* @enum {Number}
|
|
1088
|
-
*
|
|
1089
|
-
*/
|
|
1090
|
-
const TRTCAudioRecordingContent_HACK_JSDOC = {
|
|
1091
|
-
/** 录制本地和远端所有音频 */
|
|
1092
|
-
TRTCAudioRecordingContentAll: 0,
|
|
1093
|
-
/** 仅录制本地音频 */
|
|
1094
|
-
TRTCAudioRecordingContentLocal: 1,
|
|
1095
|
-
/** 仅录制远端音频 */
|
|
1096
|
-
TRTCAudioRecordingContentRemote: 2,
|
|
1097
|
-
};
|
|
1098
|
-
var TRTCAudioRecordingContent;
|
|
1099
|
-
(function (TRTCAudioRecordingContent) {
|
|
1100
|
-
TRTCAudioRecordingContent[TRTCAudioRecordingContent["TRTCAudioRecordingContentAll"] = 0] = "TRTCAudioRecordingContentAll";
|
|
1101
|
-
TRTCAudioRecordingContent[TRTCAudioRecordingContent["TRTCAudioRecordingContentLocal"] = 1] = "TRTCAudioRecordingContentLocal";
|
|
1102
|
-
TRTCAudioRecordingContent[TRTCAudioRecordingContent["TRTCAudioRecordingContentRemote"] = 2] = "TRTCAudioRecordingContentRemote";
|
|
1103
|
-
})(TRTCAudioRecordingContent = exports.TRTCAudioRecordingContent || (exports.TRTCAudioRecordingContent = {}));
|
|
1104
|
-
/**
|
|
1105
|
-
* 5.13 云端混流(转码)配置
|
|
1002
|
+
* 5.11 云端混流(转码)配置
|
|
1106
1003
|
*
|
|
1107
1004
|
* 包括最终编码质量和各路画面的摆放位置
|
|
1108
1005
|
*
|
|
@@ -1156,14 +1053,13 @@ class TRTCTranscodingConfig {
|
|
|
1156
1053
|
this.audioBitrate = audioBitrate;
|
|
1157
1054
|
this.audioChannels = audioChannels;
|
|
1158
1055
|
this.mixUsersArray = mixUsersArray;
|
|
1159
|
-
this.mixUsersArraySize = mixUsersArray.length;
|
|
1160
1056
|
this.streamId = streamId;
|
|
1161
1057
|
}
|
|
1162
1058
|
}
|
|
1163
1059
|
exports.TRTCTranscodingConfig = TRTCTranscodingConfig;
|
|
1164
1060
|
;
|
|
1165
1061
|
/**
|
|
1166
|
-
* 5.
|
|
1062
|
+
* 5.12 CDN 旁路推流参数
|
|
1167
1063
|
*
|
|
1168
1064
|
* @param {Number} appId - 腾讯云 AppID,请在 [实时音视频控制台](https://console.cloud.tencent.com/rav) 选择已经创建的应用,单击【帐号信息】后,在“直播信息”中获取
|
|
1169
1065
|
* @param {Number} bizId - 腾讯云直播 bizId,请在 [实时音视频控制台](https://console.cloud.tencent.com/rav) 选择已经创建的应用,单击【帐号信息】后,在“直播信息”中获取
|
|
@@ -1180,25 +1076,23 @@ class TRTCPublishCDNParam {
|
|
|
1180
1076
|
exports.TRTCPublishCDNParam = TRTCPublishCDNParam;
|
|
1181
1077
|
;
|
|
1182
1078
|
/**
|
|
1183
|
-
* 5.
|
|
1079
|
+
* 5.13 录音参数
|
|
1184
1080
|
*
|
|
1185
1081
|
* 请正确填写参数,确保录音文件顺利生成。
|
|
1186
1082
|
*
|
|
1187
|
-
* @param {String} filePath
|
|
1188
|
-
*
|
|
1189
|
-
*
|
|
1190
|
-
* 【特别说明】默认录制所有本地和远端音频。
|
|
1083
|
+
* @param {String} filePath - 【字段含义】文件路径(必填),录音文件的保存路径。该路径需要用户自行指定,请确保路径存在且可写。<br>
|
|
1084
|
+
* 【特别说明】该路径需精确到文件名及格式后缀,格式后缀决定录制文件的格式,例如:指定路径为 path/to/audio.aac,则会生成一个 AAC 格式的文件。目前支持的格式有 PCM, WAV, AAC
|
|
1085
|
+
*
|
|
1191
1086
|
*/
|
|
1192
1087
|
class TRTCAudioRecordingParams {
|
|
1193
|
-
constructor(filePath = null
|
|
1088
|
+
constructor(filePath = null) {
|
|
1194
1089
|
this.filePath = filePath;
|
|
1195
|
-
this.recordingContent = recordingContent;
|
|
1196
1090
|
}
|
|
1197
1091
|
}
|
|
1198
1092
|
exports.TRTCAudioRecordingParams = TRTCAudioRecordingParams;
|
|
1199
1093
|
;
|
|
1200
1094
|
/**
|
|
1201
|
-
* 5.
|
|
1095
|
+
* 5.14 音效
|
|
1202
1096
|
*
|
|
1203
1097
|
* @param {Number} effectId - 【字段含义】音效 ID<br>
|
|
1204
1098
|
* 【特殊说明】SDK 允许播放多路音效,因此需要音效 ID 进行标记,用于控制音效的开始、停止、音量等
|
|
@@ -1300,9 +1194,6 @@ exports.TRTCRemoteStatistics = TRTCRemoteStatistics;
|
|
|
1300
1194
|
* @param {Number} rtt - 延迟(毫秒),代表 SDK 跟服务器一来一回之间所消耗的时间,这个值越小越好。
|
|
1301
1195
|
* 一般低于50ms的 rtt 是比较理想的情况,而高于100ms的 rtt 会引入较大的通话延时。
|
|
1302
1196
|
* 由于数据上下行共享一条网络连接,所以 local 和 remote 的 rtt 相同。
|
|
1303
|
-
* @param {Number} gatewayRtt - 延迟(毫秒),指 SDK 到本地路由器网关一次网络往返时间,该值越小越好。
|
|
1304
|
-
* 一般低于 50ms 的 gatewayRtt 相对理想,而高于 200ms 的 gatewayRtt 会引入较大的通话延时。
|
|
1305
|
-
* 当网络为蜂窝网非 WiFi 类型时,该值无效。
|
|
1306
1197
|
* @param {Number} receivedBytes - 总接收字节数(包含信令和音视频)
|
|
1307
1198
|
* @param {Number} sentBytes - 总发送字节总数(包含信令和音视频)
|
|
1308
1199
|
* @param {TRTCLocalStatistics[]} localStatisticsArray - 自己本地的音视频统计信息,由于可能有大画面、小画面以及辅路画面等多路的情况,所以是一个数组
|
|
@@ -1312,13 +1203,12 @@ exports.TRTCRemoteStatistics = TRTCRemoteStatistics;
|
|
|
1312
1203
|
*
|
|
1313
1204
|
*/
|
|
1314
1205
|
class TRTCStatistics {
|
|
1315
|
-
constructor(upLoss = 0, downLoss = 0, appCpu = 0, systemCpu = 0, rtt = 0,
|
|
1206
|
+
constructor(upLoss = 0, downLoss = 0, appCpu = 0, systemCpu = 0, rtt = 0, receivedBytes = 0, sentBytes = 0, localStatisticsArray = [], localStatisticsArraySize = 0, remoteStatisticsArray = [], remoteStatisticsArraySize = 0) {
|
|
1316
1207
|
this.upLoss = upLoss;
|
|
1317
1208
|
this.downLoss = downLoss;
|
|
1318
1209
|
this.appCpu = appCpu;
|
|
1319
1210
|
this.systemCpu = systemCpu;
|
|
1320
1211
|
this.rtt = rtt;
|
|
1321
|
-
this.gatewayRtt = gatewayRtt;
|
|
1322
1212
|
this.receivedBytes = receivedBytes;
|
|
1323
1213
|
this.sentBytes = sentBytes;
|
|
1324
1214
|
this.localStatisticsArray = localStatisticsArray;
|