trtc-electron-sdk 11.3.601-alpha.3 → 11.3.601-alpha.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/liteav/trtc.d.ts +6 -2
- package/liteav/trtc.js +14 -10
- package/package.json +1 -1
package/liteav/trtc.d.ts
CHANGED
|
@@ -877,9 +877,11 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
877
877
|
* @param {Number} config.audioSampleRate - 最终转码后的音频采样率
|
|
878
878
|
* @param {Number} config.audioBitrate - 最终转码后的音频码率,单位:kbps
|
|
879
879
|
* @param {Number} config.audioChannels - 最终转码后的音频声道数
|
|
880
|
+
* @param {Number} config.audioCodec - 指定云端转码的输出流音频编码类型,默认为0
|
|
880
881
|
* @param {String} config.backgroundColor - 混合后画面的底色颜色,格式为十六进制数字,比如:“0x61B9F1” 代表 RGB 分别为(97,158,241)
|
|
881
882
|
* @param {String} config.backgroundImage - 混合后画面的背景图
|
|
882
883
|
* @param {String} config.streamId - 输出到 CDN 上的直播流 ID
|
|
884
|
+
* @param {String} config.videoSeiParams - 混流 SEI 参数,默认不填写
|
|
883
885
|
* @param {TRTCMixUser[]} config.mixUsersArray - 每一路子画面的位置信息
|
|
884
886
|
* @param {String} config.mixUsersArray[].userId - 参与混流的 userId
|
|
885
887
|
* @param {String} config.mixUsersArray[].roomId - 参与混流的 roomId,跨房流传入的实际 roomId。当前房间流,请传入空字符串(roomId = '')。
|
|
@@ -893,6 +895,7 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
893
895
|
* @param {TRTCVideoStreamType} config.mixUsersArray[].streamType - TRTCVideoStreamTypeBig:主路画面,一般用于摄像头;TRTCVideoStreamTypeSub:辅路画面,一般用于屏幕分享。
|
|
894
896
|
* @param {TRTCMixInputType} config.mixUsersArray[].inputType - 指定该路流的混合内容(只混音频、只混视频、混合音视频、混入水印)。TRTCMixInputTypePureAudio:只混音频; TRTCMixInputTypeAudioVideo:混合音视频;TRTCMixInputTypeWatermark:混入水印。
|
|
895
897
|
* @param {Number} config.mixUsersArray[].renderMode - 该画面在输出时的显示模式。视频流默认为0。0为裁剪,1为缩放,2为缩放并显示黑底。
|
|
898
|
+
* @param {Number} config.mixUsersArray[].soundLevel - 该路音频参与混音时的音量等级(取值范围:0 - 100),默认值:100。
|
|
896
899
|
* @param {String} config.mixUsersArray[].image - 占位图是指当对应 userId 混流内容为纯音频时,混合后的画面中显示的是占位图片。水印图是指一张贴在混合后画面中的半透明图片,这张图片会一直覆盖于混合后的画面上。当指定 inputType 为 TRTCMixInputTypePureAudio 时,image 为占位图,此时需要您指定 userId。当指定 inputType 为 TRTCMixInputTypeWatermark 时,image 为水印图,此时不需要您指定 userId。
|
|
897
900
|
*/
|
|
898
901
|
setMixTranscodingConfig(config: any): void;
|
|
@@ -1382,7 +1385,7 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
1382
1385
|
* }
|
|
1383
1386
|
* @return {TRTCDeviceInfo[]} 麦克风管理器列表
|
|
1384
1387
|
*/
|
|
1385
|
-
getMicDevicesList(): any
|
|
1388
|
+
getMicDevicesList(): any;
|
|
1386
1389
|
/**
|
|
1387
1390
|
* 获取当前选择的麦克风
|
|
1388
1391
|
*
|
|
@@ -1434,7 +1437,7 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
1434
1437
|
* }
|
|
1435
1438
|
* @return {TRTCDeviceInfo[]} 扬声器管理器列表
|
|
1436
1439
|
*/
|
|
1437
|
-
getSpeakerDevicesList(): any
|
|
1440
|
+
getSpeakerDevicesList(): any;
|
|
1438
1441
|
/**
|
|
1439
1442
|
* 获取当前的扬声器设备
|
|
1440
1443
|
*
|
|
@@ -2119,6 +2122,7 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
2119
2122
|
* @param {String} params.userSig - 用户签名
|
|
2120
2123
|
* @param {Number} params.expectedUpBandwidth - 预期的上行带宽(kbps,取值范围: 10 ~ 5000,为 0 时不测试)。
|
|
2121
2124
|
* @param {Number} params.expectedDownBandwidth - 预期的下行带宽(kbps,取值范围: 10 ~ 5000,为 0 时不测试)。
|
|
2125
|
+
* @param {Number} params.scene - 测速场景
|
|
2122
2126
|
*
|
|
2123
2127
|
* @return 接口调用结果,< 0:失败
|
|
2124
2128
|
*/
|
package/liteav/trtc.js
CHANGED
|
@@ -1638,7 +1638,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
1638
1638
|
startPublishCDNStream(param) {
|
|
1639
1639
|
const streamId = param.streamId ? param.streamId.trim() : "";
|
|
1640
1640
|
if (param instanceof trtc_define_1.TRTCPublishCDNParam) {
|
|
1641
|
-
this.rtcCloud.startPublishCDNStream(param
|
|
1641
|
+
this.rtcCloud.startPublishCDNStream(param);
|
|
1642
1642
|
}
|
|
1643
1643
|
else {
|
|
1644
1644
|
console.error('trtc:startPublishCDNStream, param is not instanceof TRTCPublishCDNParam!');
|
|
@@ -1696,9 +1696,11 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
1696
1696
|
* @param {Number} config.audioSampleRate - 最终转码后的音频采样率
|
|
1697
1697
|
* @param {Number} config.audioBitrate - 最终转码后的音频码率,单位:kbps
|
|
1698
1698
|
* @param {Number} config.audioChannels - 最终转码后的音频声道数
|
|
1699
|
+
* @param {Number} config.audioCodec - 指定云端转码的输出流音频编码类型,默认为0
|
|
1699
1700
|
* @param {String} config.backgroundColor - 混合后画面的底色颜色,格式为十六进制数字,比如:“0x61B9F1” 代表 RGB 分别为(97,158,241)
|
|
1700
1701
|
* @param {String} config.backgroundImage - 混合后画面的背景图
|
|
1701
1702
|
* @param {String} config.streamId - 输出到 CDN 上的直播流 ID
|
|
1703
|
+
* @param {String} config.videoSeiParams - 混流 SEI 参数,默认不填写
|
|
1702
1704
|
* @param {TRTCMixUser[]} config.mixUsersArray - 每一路子画面的位置信息
|
|
1703
1705
|
* @param {String} config.mixUsersArray[].userId - 参与混流的 userId
|
|
1704
1706
|
* @param {String} config.mixUsersArray[].roomId - 参与混流的 roomId,跨房流传入的实际 roomId。当前房间流,请传入空字符串(roomId = '')。
|
|
@@ -1712,11 +1714,12 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
1712
1714
|
* @param {TRTCVideoStreamType} config.mixUsersArray[].streamType - TRTCVideoStreamTypeBig:主路画面,一般用于摄像头;TRTCVideoStreamTypeSub:辅路画面,一般用于屏幕分享。
|
|
1713
1715
|
* @param {TRTCMixInputType} config.mixUsersArray[].inputType - 指定该路流的混合内容(只混音频、只混视频、混合音视频、混入水印)。TRTCMixInputTypePureAudio:只混音频; TRTCMixInputTypeAudioVideo:混合音视频;TRTCMixInputTypeWatermark:混入水印。
|
|
1714
1716
|
* @param {Number} config.mixUsersArray[].renderMode - 该画面在输出时的显示模式。视频流默认为0。0为裁剪,1为缩放,2为缩放并显示黑底。
|
|
1717
|
+
* @param {Number} config.mixUsersArray[].soundLevel - 该路音频参与混音时的音量等级(取值范围:0 - 100),默认值:100。
|
|
1715
1718
|
* @param {String} config.mixUsersArray[].image - 占位图是指当对应 userId 混流内容为纯音频时,混合后的画面中显示的是占位图片。水印图是指一张贴在混合后画面中的半透明图片,这张图片会一直覆盖于混合后的画面上。当指定 inputType 为 TRTCMixInputTypePureAudio 时,image 为占位图,此时需要您指定 userId。当指定 inputType 为 TRTCMixInputTypeWatermark 时,image 为水印图,此时不需要您指定 userId。
|
|
1716
1719
|
*/
|
|
1717
1720
|
setMixTranscodingConfig(config) {
|
|
1718
1721
|
if (config === null) {
|
|
1719
|
-
this.rtcCloud.setMixTranscodingConfig(
|
|
1722
|
+
this.rtcCloud.setMixTranscodingConfig(null);
|
|
1720
1723
|
return;
|
|
1721
1724
|
}
|
|
1722
1725
|
// configModeMap 为了兼容 TRTC_ 下划线用法
|
|
@@ -1746,7 +1749,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
1746
1749
|
config.mixUsersArray = [];
|
|
1747
1750
|
break;
|
|
1748
1751
|
}
|
|
1749
|
-
this.rtcCloud.setMixTranscodingConfig(
|
|
1752
|
+
this.rtcCloud.setMixTranscodingConfig(config);
|
|
1750
1753
|
}
|
|
1751
1754
|
else {
|
|
1752
1755
|
console.error('trtc:setMixTranscodingConfig, config is not instanceof TRTCTranscodingConfig!');
|
|
@@ -2113,7 +2116,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
2113
2116
|
*/
|
|
2114
2117
|
setNetworkQosParam(params) {
|
|
2115
2118
|
if (params instanceof trtc_define_1.TRTCNetworkQosParam) {
|
|
2116
|
-
this.rtcCloud.setNetworkQosParam(params
|
|
2119
|
+
this.rtcCloud.setNetworkQosParam(params);
|
|
2117
2120
|
}
|
|
2118
2121
|
else {
|
|
2119
2122
|
console.error('trtc:setNetworkQosParam, params is not instanceof TRTCNetworkQosParam!');
|
|
@@ -2537,7 +2540,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
2537
2540
|
if (typeof params === 'string') {
|
|
2538
2541
|
const path = params;
|
|
2539
2542
|
const recordParams = new trtc_define_1.TRTCAudioRecordingParams(path);
|
|
2540
|
-
return this.rtcCloud.startAudioRecording(recordParams
|
|
2543
|
+
return this.rtcCloud.startAudioRecording(recordParams);
|
|
2541
2544
|
}
|
|
2542
2545
|
console.error('trtc:startAudioRecording, params is not instanceof TRTCAudioRecordingParams!');
|
|
2543
2546
|
return -1;
|
|
@@ -2591,7 +2594,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
2591
2594
|
* @return {TRTCDeviceInfo[]} 摄像头管理器列表
|
|
2592
2595
|
*/
|
|
2593
2596
|
getCameraDevicesList() {
|
|
2594
|
-
const deviceInfos =
|
|
2597
|
+
const deviceInfos = this.rtcCloud.getDevicesList(trtc_define_1.TRTCDeviceType.TRTCDeviceTypeCamera);
|
|
2595
2598
|
deviceInfos.forEach(item => {
|
|
2596
2599
|
try {
|
|
2597
2600
|
if (item.deviceProperties) {
|
|
@@ -2643,7 +2646,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
2643
2646
|
* @return {TRTCDeviceInfo[]} 麦克风管理器列表
|
|
2644
2647
|
*/
|
|
2645
2648
|
getMicDevicesList() {
|
|
2646
|
-
return
|
|
2649
|
+
return this.rtcCloud.getDevicesList(trtc_define_1.TRTCDeviceType.TRTCDeviceTypeMic);
|
|
2647
2650
|
}
|
|
2648
2651
|
/**
|
|
2649
2652
|
* 获取当前选择的麦克风
|
|
@@ -2709,7 +2712,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
2709
2712
|
* @return {TRTCDeviceInfo[]} 扬声器管理器列表
|
|
2710
2713
|
*/
|
|
2711
2714
|
getSpeakerDevicesList() {
|
|
2712
|
-
return
|
|
2715
|
+
return this.rtcCloud.getDevicesList(trtc_define_1.TRTCDeviceType.TRTCDeviceTypeSpeaker);
|
|
2713
2716
|
}
|
|
2714
2717
|
/**
|
|
2715
2718
|
* 获取当前的扬声器设备
|
|
@@ -3694,17 +3697,18 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
3694
3697
|
* @param {String} params.userSig - 用户签名
|
|
3695
3698
|
* @param {Number} params.expectedUpBandwidth - 预期的上行带宽(kbps,取值范围: 10 ~ 5000,为 0 时不测试)。
|
|
3696
3699
|
* @param {Number} params.expectedDownBandwidth - 预期的下行带宽(kbps,取值范围: 10 ~ 5000,为 0 时不测试)。
|
|
3700
|
+
* @param {Number} params.scene - 测速场景
|
|
3697
3701
|
*
|
|
3698
3702
|
* @return 接口调用结果,< 0:失败
|
|
3699
3703
|
*/
|
|
3700
3704
|
startSpeedTest(params, userId, userSig) {
|
|
3701
3705
|
if (params instanceof trtc_define_1.TRTCSpeedTestParams) {
|
|
3702
|
-
return this.rtcCloud.startSpeedTest(params
|
|
3706
|
+
return this.rtcCloud.startSpeedTest(params);
|
|
3703
3707
|
}
|
|
3704
3708
|
if (userId !== undefined && userSig !== undefined) {
|
|
3705
3709
|
const sdkAppId = params;
|
|
3706
3710
|
const speedTestParams = new trtc_define_1.TRTCSpeedTestParams(sdkAppId, userId, userSig);
|
|
3707
|
-
return this.rtcCloud.startSpeedTest(
|
|
3711
|
+
return this.rtcCloud.startSpeedTest(params);
|
|
3708
3712
|
}
|
|
3709
3713
|
console.error('startSpeedTest, param is error');
|
|
3710
3714
|
return -1;
|