trtc-electron-sdk 10.3.8-beta.3 → 10.3.401-beta.2
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 -51
- package/liteav/trtc.js +134 -76
- package/liteav/trtc_define.d.ts +1 -1
- package/liteav/trtc_define.js +2 -2
- package/package.json +11 -9
- package/scripts/download.js +0 -27
- package/scripts/prerelase.js +11 -0
- package/scripts/publish-doc.js +1 -1
package/liteav/trtc.d.ts
CHANGED
|
@@ -54,7 +54,17 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
54
54
|
*/
|
|
55
55
|
static destroyTRTCShareInstance(): void;
|
|
56
56
|
/**
|
|
57
|
-
*
|
|
57
|
+
* 获取 TRTC 配置对象
|
|
58
|
+
*
|
|
59
|
+
* 可以通过 TRTC 配置对象 {@link TRTCConfig} 打开 debug 模式
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* // Enable 'debug' mode
|
|
63
|
+
* const TRTCCloud = require('trtc-electron-sdk');
|
|
64
|
+
* const rtcCloud = new TRTCCloud();
|
|
65
|
+
* rtcCloud.getConfigObject().setDebugMode(true);
|
|
66
|
+
*
|
|
67
|
+
* @returns {TRTCConfig}
|
|
58
68
|
*/
|
|
59
69
|
getConfigObject(): import("./Render/util").Config;
|
|
60
70
|
setExternalRenderEnabled(enabled: boolean): void;
|
|
@@ -194,11 +204,11 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
194
204
|
/**
|
|
195
205
|
* 3.3 用户是否开启摄像头视频
|
|
196
206
|
*
|
|
197
|
-
* 当您收到 onUserVideoAvailable(userId,
|
|
207
|
+
* 当您收到 onUserVideoAvailable(userId, 1) 通知时,代表该路画面已经有可用的视频数据帧到达。
|
|
198
208
|
* 之后,您需要调用 [startRemoteView()]{@link TRTCCloud#startRemoteView} 接口加载该用户的远程画面。
|
|
199
209
|
* 再之后,您还会收到名为 onFirstVideoFrame(userId) 的首帧画面渲染回调。
|
|
200
210
|
*
|
|
201
|
-
* 当您收到了 onUserVideoAvailable(userId,
|
|
211
|
+
* 当您收到了 onUserVideoAvailable(userId, 0) 通知时,代表该路远程画面已经被关闭,这可能是
|
|
202
212
|
* 由于该用户调用了 [muteLocalVideo()]{@link TRTCCloud#muteLocalVideo} 或 [stopLocalPreview()]{@link TRTCCloud#stopLocalPreview} 所致。
|
|
203
213
|
*
|
|
204
214
|
* @event TRTCCallback#onUserVideoAvailable
|
|
@@ -209,7 +219,7 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
209
219
|
/**
|
|
210
220
|
* 3.4 用户是否开启了辅路画面(TRTCVideoStreamTypeSub,一般用于屏幕分享)
|
|
211
221
|
*
|
|
212
|
-
* 注意:显示辅路画面使用的函数是
|
|
222
|
+
* 注意:显示辅路画面使用的函数是[startRemoteView()]{@link TRTCCloud#startRemoteView}, 从 8.0 版本开始已不再推荐使用 [startRemoteSubStreamView()]{@link TRTCCloud#startRemoteSubStreamView}。
|
|
213
223
|
*
|
|
214
224
|
* @event TRTCCallback#onUserSubStreamAvailable
|
|
215
225
|
* @param {String} userId - 用户标识
|
|
@@ -661,7 +671,7 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
661
671
|
*
|
|
662
672
|
* @param {TRTCSwitchRoomParam} params 房间切换参数,请参考 {@link TRTCSwitchRoomParam}
|
|
663
673
|
*
|
|
664
|
-
* 接口调用结果会通过
|
|
674
|
+
* 接口调用结果会通过 onSwitchRoom(errCode, errMsg) 事件回调通知给您。
|
|
665
675
|
*/
|
|
666
676
|
switchRoom(params: TRTCSwitchRoomParam): void;
|
|
667
677
|
/**
|
|
@@ -690,13 +700,13 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
690
700
|
* <pre>
|
|
691
701
|
* 房间 001 房间 002
|
|
692
702
|
* ------------- ------------
|
|
693
|
-
*
|
|
703
|
+
* 跨房连麦前: | 主播 A | | 主播 B |
|
|
694
704
|
* | 观众 U V W | | 观众 X Y Z |
|
|
695
705
|
* ------------- ------------
|
|
696
706
|
*
|
|
697
707
|
* 房间 001 房间 002
|
|
698
708
|
* ------------- ------------
|
|
699
|
-
*
|
|
709
|
+
* 跨房连麦后: | 主播 A B | | 主播 B A |
|
|
700
710
|
* | 观众 U V W | | 观众 X Y Z |
|
|
701
711
|
* ------------- ------------
|
|
702
712
|
* </pre>
|
|
@@ -809,6 +819,8 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
809
819
|
*
|
|
810
820
|
* 参考文档:[云端混流转码](https://cloud.tencent.com/document/product/647/16827)。
|
|
811
821
|
*
|
|
822
|
+
* 注意:混流转码为收费功能,调用接口将产生云端混流转码费用,详见 [云端混流转码计费说明](https://cloud.tencent.com/document/product/647/49446)。
|
|
823
|
+
*
|
|
812
824
|
* @note 关于云端混流的注意事项:
|
|
813
825
|
* - 云端转码会引入一定的 CDN 观看延时,大概会增加1 - 2秒。
|
|
814
826
|
* - 调用该函数的用户,会将连麦中的多路画面混合到自己当前这路画面中。
|
|
@@ -830,7 +842,7 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
830
842
|
* @param {String} config.streamId - 输出到 CDN 上的直播流 ID
|
|
831
843
|
* @param {TRTCMixUser[]} config.mixUsersArray - 每一路子画面的位置信息
|
|
832
844
|
* @param {String} config.mixUsersArray[].userId - 参与混流的 userId
|
|
833
|
-
* @param {String} config.mixUsersArray[].roomId - 参与混流的 roomId,跨房流传入的实际 roomId
|
|
845
|
+
* @param {String} config.mixUsersArray[].roomId - 参与混流的 roomId,跨房流传入的实际 roomId。当前房间流,请传入空字符串(roomId = '')。
|
|
834
846
|
* @param {Rect} config.mixUsersArray[].rect - 图层位置坐标以及大小,左上角为坐标原点(0,0) (绝对像素值)
|
|
835
847
|
* @param {Number} config.mixUsersArray[].rect.left - 图层位置的左坐标
|
|
836
848
|
* @param {Number} config.mixUsersArray[].rect.top - 图层位置的上坐标
|
|
@@ -855,16 +867,23 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
855
867
|
*/
|
|
856
868
|
stopLocalPreview(): void;
|
|
857
869
|
/**
|
|
858
|
-
* 3.3
|
|
870
|
+
* 3.3 暂停/恢复发布本地的视频流
|
|
859
871
|
*
|
|
860
|
-
*
|
|
861
|
-
*
|
|
872
|
+
* 该接口可以暂停(或恢复)发布本地的视频画面,暂停之后,同一房间中的其他用户将无法继续看到自己画面。
|
|
873
|
+
* 该接口在指定 TRTCVideoStreamTypeBig 时等效于 start/stopLocalPreview 这两个接口,但具有更好的响应速度。
|
|
874
|
+
* 因为 start/stopLocalPreview 需要打开和关闭摄像头,而打开和关闭摄像头都是硬件设备相关的操作,非常耗时。
|
|
875
|
+
* 相比之下,muteLocalVideo 只需要在软件层面对数据流进行暂停或者放行即可,因此效率更高,也更适合需要频繁打开关闭的场景。
|
|
876
|
+
* 当暂停/恢复发布指定 TRTCVideoStreamTypeBig 后,同一房间中的其他用户将会收到 onUserVideoAvailable 回调通知。
|
|
877
|
+
* 当暂停/恢复发布指定 TRTCVideoStreamTypeSub 后,同一房间中的其他用户将会收到 onUserSubStreamAvailable 回调通知。
|
|
878
|
+
*
|
|
879
|
+
* @param {Boolean} mute - true:屏蔽;false:开启,默认值:false
|
|
880
|
+
* @param {TRTCVideoStreamType} streamType - 要暂停/恢复的视频流类型, 仅支持 TRTCVideoStreamTypeBig 和 TRTCVideoStreamTypeSub
|
|
862
881
|
*/
|
|
863
882
|
muteLocalVideo(mute: boolean, streamType?: TRTCVideoStreamType): void;
|
|
864
883
|
/**
|
|
865
884
|
* 3.4 开始显示远端视频画面
|
|
866
885
|
*
|
|
867
|
-
* 在收到 SDK 的 onUserVideoAvailable(userId,
|
|
886
|
+
* 在收到 SDK 的 onUserVideoAvailable(userId, 1) 通知时,可以获知该远程用户开启了视频,
|
|
868
887
|
* 此后调用 startRemoteView(userId) 接口加载该用户的远程画面时,可以用 loading 动画优化加载过程中的等待体验。
|
|
869
888
|
* 待该用户的首帧画面开始显示时,您会收到 onFirstVideoFrame(userId) 事件回调。
|
|
870
889
|
*
|
|
@@ -953,7 +972,7 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
953
972
|
*/
|
|
954
973
|
setLocalViewFillMode(mode: TRTCVideoFillMode): void;
|
|
955
974
|
/**
|
|
956
|
-
* 3.13
|
|
975
|
+
* 3.13 设置远端画面的渲染模式
|
|
957
976
|
*
|
|
958
977
|
* @param {String} userId - 用户 ID
|
|
959
978
|
* @param {TRTCVideoStreamType} streamType - 视频流类型
|
|
@@ -1116,7 +1135,11 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
1116
1135
|
*/
|
|
1117
1136
|
muteRemoteAudio(userId: string, mute: boolean): void;
|
|
1118
1137
|
/**
|
|
1119
|
-
* 4.5
|
|
1138
|
+
* 4.5 静音/取消静音所有远端用户的音频流
|
|
1139
|
+
*
|
|
1140
|
+
* 当您静音所有用户的远端音频时,SDK 会停止播放所有来自远端的音频流,同时也会停止拉取所有用户的音频数据。
|
|
1141
|
+
*
|
|
1142
|
+
* 注意:该接口支持您在进入房间(enterRoom)前调用,暂停状态会在退出房间(exitRoom)在之后会被重置。
|
|
1120
1143
|
*
|
|
1121
1144
|
* @param {Boolean} mute - true:静音;false:非静音
|
|
1122
1145
|
*/
|
|
@@ -1205,11 +1228,18 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
1205
1228
|
* - TRTCAudioQualityMusic: 音乐模式:采样率:48k
|
|
1206
1229
|
*/
|
|
1207
1230
|
setAudioQuality(quality: TRTCAudioQuality): void;
|
|
1231
|
+
/**
|
|
1232
|
+
* 4.15 废弃接口:设置麦克风的音量大小
|
|
1233
|
+
*
|
|
1234
|
+
* @deprecated 从 TRTCSDK6.9 后该接口已被废弃,请使用 setAudioCaptureVolume 接口替代。
|
|
1235
|
+
* @param {Number} volume - 音量大小,100为正常音量,取值范围为0 - 200。
|
|
1236
|
+
*/
|
|
1237
|
+
setMicVolumeOnMixing(volume: number): void;
|
|
1208
1238
|
/**
|
|
1209
1239
|
* 5.1 获取摄像头设备列表
|
|
1210
1240
|
*
|
|
1211
1241
|
* @example
|
|
1212
|
-
* var cameralist =
|
|
1242
|
+
* var cameralist = rtcCloud.getCameraDevicesList();
|
|
1213
1243
|
* for (i=0;i<cameralist.length;i++) {
|
|
1214
1244
|
* var camera = cameralist[i];
|
|
1215
1245
|
* console.info("camera deviceName: " + camera.deviceName + " deviceId:" + camera.deviceId);
|
|
@@ -1233,7 +1263,7 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
1233
1263
|
* 6.1 获取麦克风设备列表
|
|
1234
1264
|
*
|
|
1235
1265
|
* @example
|
|
1236
|
-
* var miclist =
|
|
1266
|
+
* var miclist = rtcCloud.getMicDevicesList();
|
|
1237
1267
|
* for (i=0;i<miclist.length;i++) {
|
|
1238
1268
|
* var mic = miclist[i];
|
|
1239
1269
|
* console.info("mic deviceName: " + mic.deviceName + " deviceId:" + mic.deviceId);
|
|
@@ -1285,7 +1315,7 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
1285
1315
|
* 6.8 获取扬声器设备列表
|
|
1286
1316
|
*
|
|
1287
1317
|
* @example
|
|
1288
|
-
* var speakerlist =
|
|
1318
|
+
* var speakerlist = rtcCloud.getSpeakerDevicesList();
|
|
1289
1319
|
* for (i=0;i<speakerlist.length;i++) {
|
|
1290
1320
|
* var speaker = speakerlist[i];
|
|
1291
1321
|
* console.info("mic deviceName: " + speaker.deviceName + " deviceId:" + speaker.deviceId);
|
|
@@ -1308,10 +1338,6 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
1308
1338
|
/**
|
|
1309
1339
|
* 6.11 获取系统当前扬声器设备音量
|
|
1310
1340
|
*
|
|
1311
|
-
* 注意:
|
|
1312
|
-
* - SDK6.7 及以下版本,windows 查询的不是系统扬声器的音量大小,mac 是查询系统扬声器音量大小
|
|
1313
|
-
* - SDK6.8 及以上版本,windows 和 mac 查询的都是系统扬声器的音量大小
|
|
1314
|
-
*
|
|
1315
1341
|
* @return {Number} 扬声器音量,范围0 - 100
|
|
1316
1342
|
*/
|
|
1317
1343
|
getCurrentSpeakerVolume(): any;
|
|
@@ -1319,8 +1345,6 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
1319
1345
|
* 6.12 设置系统当前扬声器设备音量
|
|
1320
1346
|
*
|
|
1321
1347
|
* 注意:该接口的功能是调节系统播放音量,如果用户直接调节系统设置的播放音量时,该接口的设置结果会被用户的操作所覆盖。
|
|
1322
|
-
* - SDK6.7 及以下版本,windows 设置的不是系统扬声器的音量大小,mac 是设置系统扬声器音量大小
|
|
1323
|
-
* - SDK6.8 及以上版本,windows 和 mac 设置的都是系统扬声器的音量大小
|
|
1324
1348
|
*
|
|
1325
1349
|
* @param {Number} volume - 设置的扬声器音量,范围0 - 100
|
|
1326
1350
|
*/
|
|
@@ -1426,7 +1450,7 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
1426
1450
|
* 8.5 枚举可共享的窗口列表
|
|
1427
1451
|
*
|
|
1428
1452
|
* 如果您要给您的 App 增加屏幕分享功能,一般需要先显示一个窗口选择界面,这样用户可以选择希望分享的窗口。
|
|
1429
|
-
*
|
|
1453
|
+
* 通过此函数,您可以获得可分享窗口的 ID、类型、窗口名称以及缩略图。
|
|
1430
1454
|
* 拿到这些信息后,您就可以实现一个窗口选择界面,当然,您也可以使用我们在 Demo 源码中已经实现好的一个界面。
|
|
1431
1455
|
*
|
|
1432
1456
|
* 注意:返回的列表中包括屏幕和应用窗口,屏幕会在列表的前面几个元素中。
|
|
@@ -1471,7 +1495,7 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
1471
1495
|
*/
|
|
1472
1496
|
selectScreenCaptureTarget(source: TRTCScreenCaptureSourceInfo | number, captureRect: Rect | string, property: TRTCScreenCaptureProperty | string, deprecatedCaptureRect?: Rect, captureMouse?: boolean, highlightWindow?: boolean): any;
|
|
1473
1497
|
/**
|
|
1474
|
-
* 8.7
|
|
1498
|
+
* 8.7 启动屏幕分享,支持选择使用主路或辅路进行屏幕分享。
|
|
1475
1499
|
*
|
|
1476
1500
|
* 注意:
|
|
1477
1501
|
* 一个用户同时最多只能上传一条主路(TRTCVideoStreamTypeBig)画面和一条辅路(TRTCVideoStreamTypeSub)画面,
|
|
@@ -1495,12 +1519,14 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
1495
1519
|
*/
|
|
1496
1520
|
stopScreenCapture(): void;
|
|
1497
1521
|
/**
|
|
1498
|
-
* 8.11
|
|
1522
|
+
* 8.11 设置屏幕分享(即辅路)的视频编码参数
|
|
1499
1523
|
*
|
|
1500
|
-
*
|
|
1501
|
-
* -
|
|
1524
|
+
* 该接口可以设定远端用户所看到的屏幕分享(即辅路)的画面质量,同时也能决定云端录制出的视频文件中屏幕分享的画面质量。 请注意如下两个接口的差异:
|
|
1525
|
+
* - setVideoEncoderParam() 用于设置主路画面(TRTCVideoStreamTypeBig,一般用于摄像头)的视频编码参数。
|
|
1526
|
+
* - setSubStreamEncoderParam() 用于设置辅路画面(TRTCVideoStreamTypeSub,一般用于屏幕分享)的视频编码参数。
|
|
1502
1527
|
*
|
|
1503
|
-
*
|
|
1528
|
+
* 注意:
|
|
1529
|
+
* 即使您使用主路传输屏幕分享(在调用 startScreenCapture 时设置 type=TRTCVideoStreamTypeBig),依然要使用 setSubStreamEncoderParam 设定屏幕分享的编码参数,而不要使用 setVideoEncoderParam 。
|
|
1504
1530
|
*
|
|
1505
1531
|
* @param {TRTCVideoEncParam} params - 辅流(屏幕分享)编码参数
|
|
1506
1532
|
* @param {TRTCVideoResolution} params.videoResolution - 视频分辨率
|
|
@@ -1773,7 +1799,13 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
1773
1799
|
*/
|
|
1774
1800
|
seekMusicToPosInTime(id: number, pts: number): any;
|
|
1775
1801
|
/**
|
|
1776
|
-
* 11.19
|
|
1802
|
+
* 11.19 设置所有背景音乐的本地音量和远端音量的大小
|
|
1803
|
+
*
|
|
1804
|
+
* 该接口可以设置所有背景音乐的本地音量和远端音量。
|
|
1805
|
+
* - 本地音量:即主播本地可以听到的背景音乐的音量大小。
|
|
1806
|
+
* - 远端音量:即观众端可以听到的背景音乐的音量大小。
|
|
1807
|
+
*
|
|
1808
|
+
* 注意:如果将 volume 设置成 100 之后感觉音量还是太小,可以将 volume 最大设置成 150,但超过 100 的 volume 会有爆音的风险,请谨慎操作。
|
|
1777
1809
|
*
|
|
1778
1810
|
* @param {Number} volume - 音量大小,100为正常音量,取值范围为0 - 200。
|
|
1779
1811
|
*/
|
|
@@ -1886,15 +1918,7 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
1886
1918
|
*/
|
|
1887
1919
|
stopSpeedTest(): void;
|
|
1888
1920
|
/**
|
|
1889
|
-
* 13.3
|
|
1890
|
-
*
|
|
1891
|
-
* @param {TRTCDeviceType} deviceType - 设备类型
|
|
1892
|
-
* @param {Boolean} enable - 是否跟随系统默认的音频设备。 true:跟随, 当系统默认音频设备发生改变时,SDK 立即切换音频设备; false:不跟随, 只有当 SDK 使用的音频设备被移除后或插入新的音频设备为系统默认设备时,SDK 才切换至系统默认的音频设备。
|
|
1893
|
-
*
|
|
1894
|
-
*/
|
|
1895
|
-
enableFollowingDefaultAudioDevice(deviceType: TRTCDeviceType, enable: boolean): void;
|
|
1896
|
-
/**
|
|
1897
|
-
* 13.4 开始进行摄像头测试
|
|
1921
|
+
* 13.3 开始进行摄像头测试
|
|
1898
1922
|
*
|
|
1899
1923
|
* 会触发 onFirstVideoFrame 回调接口
|
|
1900
1924
|
*
|
|
@@ -1904,11 +1928,11 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
1904
1928
|
*/
|
|
1905
1929
|
startCameraDeviceTest(view: HTMLElement): void;
|
|
1906
1930
|
/**
|
|
1907
|
-
* 13.
|
|
1931
|
+
* 13.4 停止摄像头测试
|
|
1908
1932
|
*/
|
|
1909
1933
|
stopCameraDeviceTest(): void;
|
|
1910
1934
|
/**
|
|
1911
|
-
* 13.
|
|
1935
|
+
* 13.5 开始进行麦克风测试
|
|
1912
1936
|
*
|
|
1913
1937
|
* 回调接口 onTestMicVolume 获取测试数据
|
|
1914
1938
|
*
|
|
@@ -1918,11 +1942,11 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
1918
1942
|
*/
|
|
1919
1943
|
startMicDeviceTest(interval: number): void;
|
|
1920
1944
|
/**
|
|
1921
|
-
* 13.
|
|
1945
|
+
* 13.6 停止麦克风测试
|
|
1922
1946
|
*/
|
|
1923
1947
|
stopMicDeviceTest(): void;
|
|
1924
1948
|
/**
|
|
1925
|
-
* 13.
|
|
1949
|
+
* 13.7 开始进行扬声器测试
|
|
1926
1950
|
*
|
|
1927
1951
|
* 回调接口 onTestSpeakerVolume 获取测试数据
|
|
1928
1952
|
*
|
|
@@ -1932,7 +1956,7 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
1932
1956
|
*/
|
|
1933
1957
|
startSpeakerDeviceTest(testAudioFilePath: string): void;
|
|
1934
1958
|
/**
|
|
1935
|
-
* 13.
|
|
1959
|
+
* 13.8 停止扬声器测试
|
|
1936
1960
|
*/
|
|
1937
1961
|
stopSpeakerDeviceTest(): void;
|
|
1938
1962
|
/**
|
|
@@ -1992,13 +2016,6 @@ declare class TRTCCloud extends EventEmitter {
|
|
|
1992
2016
|
* @param {String} jsonStr - 接口及参数描述的 JSON 字符串
|
|
1993
2017
|
*/
|
|
1994
2018
|
callExperimentalAPI(jsonStr: string): void;
|
|
1995
|
-
/**
|
|
1996
|
-
* 从 TRTCSDK6.9 后该接口已被废弃
|
|
1997
|
-
*
|
|
1998
|
-
* @deprecated 从 TRTCSDK6.9 后该接口已被废弃,请使用 setAudioCaptureVolume 接口替代。
|
|
1999
|
-
* @param {Number} volume - 音量大小,100为正常音量,取值范围为0 - 200。
|
|
2000
|
-
*/
|
|
2001
|
-
setMicVolumeOnMixing(volume: number): void;
|
|
2002
2019
|
addLocalVideoRenderCallback(): void;
|
|
2003
2020
|
addRemoteVideoRenderCallback(userId: string): void;
|
|
2004
2021
|
/**
|
package/liteav/trtc.js
CHANGED
|
@@ -108,6 +108,38 @@ let formatLogParams = function (params) {
|
|
|
108
108
|
}
|
|
109
109
|
return logParamsStr;
|
|
110
110
|
};
|
|
111
|
+
const getComponentNO = function () {
|
|
112
|
+
var _a;
|
|
113
|
+
let componentName = '';
|
|
114
|
+
// @ts-ignore
|
|
115
|
+
if (global.__TRTCElectron && global.__TRTCElectron.componentName) {
|
|
116
|
+
// @ts-ignore
|
|
117
|
+
componentName = global.__TRTCElectron.componentName;
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
const jsonStr = (_a = global.localStorage) === null || _a === void 0 ? void 0 : _a.getItem('__TRTCElectron');
|
|
121
|
+
if (jsonStr) {
|
|
122
|
+
try {
|
|
123
|
+
const jsonObj = JSON.parse(jsonStr);
|
|
124
|
+
if (jsonObj.componentName && typeof jsonObj.componentName === 'string') {
|
|
125
|
+
componentName = jsonObj.componentName;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
catch (error) {
|
|
129
|
+
console.warn('trtc: localstorage TRTCElectron parse error.', error);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
let componentNO = '';
|
|
134
|
+
switch (componentName) {
|
|
135
|
+
case 'TUIRoom':
|
|
136
|
+
componentNO = '5';
|
|
137
|
+
break;
|
|
138
|
+
default:
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
return componentNO;
|
|
142
|
+
};
|
|
111
143
|
let trtcCloudInstance = null;
|
|
112
144
|
let oriRtcCloud = null;
|
|
113
145
|
const renderModePixelFormatMap = new Map();
|
|
@@ -134,7 +166,8 @@ renderModePixelFormatMap.set(8, trtc_define_1.TRTCVideoPixelFormat.TRTCVideoPixe
|
|
|
134
166
|
class TRTCCloud extends events_1.EventEmitter {
|
|
135
167
|
constructor() {
|
|
136
168
|
super();
|
|
137
|
-
|
|
169
|
+
const componentNO = getComponentNO();
|
|
170
|
+
oriRtcCloud = new trtc.NodeRTCCloud(pkg.version, componentNO);
|
|
138
171
|
this.rtcCloud = Object.assign({}, oriRtcCloud, {
|
|
139
172
|
onlineLog: undefined
|
|
140
173
|
});
|
|
@@ -193,7 +226,17 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
193
226
|
}
|
|
194
227
|
}
|
|
195
228
|
/**
|
|
196
|
-
*
|
|
229
|
+
* 获取 TRTC 配置对象
|
|
230
|
+
*
|
|
231
|
+
* 可以通过 TRTC 配置对象 {@link TRTCConfig} 打开 debug 模式
|
|
232
|
+
*
|
|
233
|
+
* @example
|
|
234
|
+
* // Enable 'debug' mode
|
|
235
|
+
* const TRTCCloud = require('trtc-electron-sdk');
|
|
236
|
+
* const rtcCloud = new TRTCCloud();
|
|
237
|
+
* rtcCloud.getConfigObject().setDebugMode(true);
|
|
238
|
+
*
|
|
239
|
+
* @returns {TRTCConfig}
|
|
197
240
|
*/
|
|
198
241
|
getConfigObject() {
|
|
199
242
|
return util_1.config;
|
|
@@ -563,11 +606,11 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
563
606
|
/**
|
|
564
607
|
* 3.3 用户是否开启摄像头视频
|
|
565
608
|
*
|
|
566
|
-
* 当您收到 onUserVideoAvailable(userId,
|
|
609
|
+
* 当您收到 onUserVideoAvailable(userId, 1) 通知时,代表该路画面已经有可用的视频数据帧到达。
|
|
567
610
|
* 之后,您需要调用 [startRemoteView()]{@link TRTCCloud#startRemoteView} 接口加载该用户的远程画面。
|
|
568
611
|
* 再之后,您还会收到名为 onFirstVideoFrame(userId) 的首帧画面渲染回调。
|
|
569
612
|
*
|
|
570
|
-
* 当您收到了 onUserVideoAvailable(userId,
|
|
613
|
+
* 当您收到了 onUserVideoAvailable(userId, 0) 通知时,代表该路远程画面已经被关闭,这可能是
|
|
571
614
|
* 由于该用户调用了 [muteLocalVideo()]{@link TRTCCloud#muteLocalVideo} 或 [stopLocalPreview()]{@link TRTCCloud#stopLocalPreview} 所致。
|
|
572
615
|
*
|
|
573
616
|
* @event TRTCCallback#onUserVideoAvailable
|
|
@@ -593,7 +636,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
593
636
|
/**
|
|
594
637
|
* 3.4 用户是否开启了辅路画面(TRTCVideoStreamTypeSub,一般用于屏幕分享)
|
|
595
638
|
*
|
|
596
|
-
* 注意:显示辅路画面使用的函数是
|
|
639
|
+
* 注意:显示辅路画面使用的函数是[startRemoteView()]{@link TRTCCloud#startRemoteView}, 从 8.0 版本开始已不再推荐使用 [startRemoteSubStreamView()]{@link TRTCCloud#startRemoteSubStreamView}。
|
|
597
640
|
*
|
|
598
641
|
* @event TRTCCallback#onUserSubStreamAvailable
|
|
599
642
|
* @param {String} userId - 用户标识
|
|
@@ -1039,8 +1082,9 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
1039
1082
|
* @event TRTCCallback#onScreenCaptureStarted
|
|
1040
1083
|
*/
|
|
1041
1084
|
handleOnScreenCaptureStarted() {
|
|
1085
|
+
console.debug('trtc:onScreenCaptureStarted');
|
|
1042
1086
|
this.isScreenCapturing = true;
|
|
1043
|
-
// 只有在 Buffer 为 null 时才新建,否则只能在 onVideoSizeChange 事件中重新申请 Buffer
|
|
1087
|
+
// 只有在 Buffer 为 null 时才新建,否则只能在 onVideoSizeChange 事件中重新申请 Buffer
|
|
1044
1088
|
if (!screenVideoBuffer.buffer) {
|
|
1045
1089
|
screenVideoBuffer.userId = '';
|
|
1046
1090
|
screenVideoBuffer.streamType = this.screenCaptureStreamType;
|
|
@@ -1049,6 +1093,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
1049
1093
|
screenVideoBuffer.width = DEFAULT_VIDEO_WIDTH;
|
|
1050
1094
|
screenVideoBuffer.height = DEFAULT_VIDEO_HEIGHT;
|
|
1051
1095
|
this.rtcCloud.setSubVideoBuffer('', screenVideoBuffer.buffer, screenVideoBuffer.streamType, screenVideoBuffer.width, screenVideoBuffer.height, screenVideoBuffer.pixelFormat);
|
|
1096
|
+
console.debug('trtc:onScreenCaptureStarted alloc add screenVideoBuffer', screenVideoBuffer);
|
|
1052
1097
|
}
|
|
1053
1098
|
this.fire('onScreenCaptureStarted');
|
|
1054
1099
|
}
|
|
@@ -1077,10 +1122,12 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
1077
1122
|
* @param {Number} reason - 停止原因,0:表示用户主动停止;1:表示屏幕分享窗口被关闭
|
|
1078
1123
|
*/
|
|
1079
1124
|
handleOnScreenCaptureStopped(reason) {
|
|
1125
|
+
console.debug('trtc:onScreenCaptureStopped', reason);
|
|
1080
1126
|
if (this.isScreenCapturing) {
|
|
1081
1127
|
if (screenVideoBuffer.buffer) {
|
|
1082
1128
|
this.rtcCloud.setSubVideoBuffer('', screenVideoBuffer.buffer, screenVideoBuffer.streamType, 0, 0, screenVideoBuffer.pixelFormat);
|
|
1083
1129
|
screenVideoBuffer.buffer = null;
|
|
1130
|
+
console.debug('trtc:onScreenCaptureStopped delete screenVideoBuffer', screenVideoBuffer);
|
|
1084
1131
|
}
|
|
1085
1132
|
this.isScreenCapturing = false;
|
|
1086
1133
|
}
|
|
@@ -1334,7 +1381,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
1334
1381
|
*
|
|
1335
1382
|
* @param {TRTCSwitchRoomParam} params 房间切换参数,请参考 {@link TRTCSwitchRoomParam}
|
|
1336
1383
|
*
|
|
1337
|
-
* 接口调用结果会通过
|
|
1384
|
+
* 接口调用结果会通过 onSwitchRoom(errCode, errMsg) 事件回调通知给您。
|
|
1338
1385
|
*/
|
|
1339
1386
|
switchRoom(params) {
|
|
1340
1387
|
this.rtcCloud.switchRoom(params.roomId, params.strRoomId, params.userSig, params.privateMapKey);
|
|
@@ -1367,13 +1414,13 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
1367
1414
|
* <pre>
|
|
1368
1415
|
* 房间 001 房间 002
|
|
1369
1416
|
* ------------- ------------
|
|
1370
|
-
*
|
|
1417
|
+
* 跨房连麦前: | 主播 A | | 主播 B |
|
|
1371
1418
|
* | 观众 U V W | | 观众 X Y Z |
|
|
1372
1419
|
* ------------- ------------
|
|
1373
1420
|
*
|
|
1374
1421
|
* 房间 001 房间 002
|
|
1375
1422
|
* ------------- ------------
|
|
1376
|
-
*
|
|
1423
|
+
* 跨房连麦后: | 主播 A B | | 主播 B A |
|
|
1377
1424
|
* | 观众 U V W | | 观众 X Y Z |
|
|
1378
1425
|
* ------------- ------------
|
|
1379
1426
|
* </pre>
|
|
@@ -1510,6 +1557,8 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
1510
1557
|
*
|
|
1511
1558
|
* 参考文档:[云端混流转码](https://cloud.tencent.com/document/product/647/16827)。
|
|
1512
1559
|
*
|
|
1560
|
+
* 注意:混流转码为收费功能,调用接口将产生云端混流转码费用,详见 [云端混流转码计费说明](https://cloud.tencent.com/document/product/647/49446)。
|
|
1561
|
+
*
|
|
1513
1562
|
* @note 关于云端混流的注意事项:
|
|
1514
1563
|
* - 云端转码会引入一定的 CDN 观看延时,大概会增加1 - 2秒。
|
|
1515
1564
|
* - 调用该函数的用户,会将连麦中的多路画面混合到自己当前这路画面中。
|
|
@@ -1531,7 +1580,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
1531
1580
|
* @param {String} config.streamId - 输出到 CDN 上的直播流 ID
|
|
1532
1581
|
* @param {TRTCMixUser[]} config.mixUsersArray - 每一路子画面的位置信息
|
|
1533
1582
|
* @param {String} config.mixUsersArray[].userId - 参与混流的 userId
|
|
1534
|
-
* @param {String} config.mixUsersArray[].roomId - 参与混流的 roomId,跨房流传入的实际 roomId
|
|
1583
|
+
* @param {String} config.mixUsersArray[].roomId - 参与混流的 roomId,跨房流传入的实际 roomId。当前房间流,请传入空字符串(roomId = '')。
|
|
1535
1584
|
* @param {Rect} config.mixUsersArray[].rect - 图层位置坐标以及大小,左上角为坐标原点(0,0) (绝对像素值)
|
|
1536
1585
|
* @param {Number} config.mixUsersArray[].rect.left - 图层位置的左坐标
|
|
1537
1586
|
* @param {Number} config.mixUsersArray[].rect.top - 图层位置的上坐标
|
|
@@ -1599,7 +1648,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
1599
1648
|
this._initRender(key, view);
|
|
1600
1649
|
}
|
|
1601
1650
|
// view 为 null 时,可能启动了自定义渲染,所以 Buffer 还是要创建,否则自定义渲染就拿不到数据;
|
|
1602
|
-
// view 非 null 时,当然必须创建 Buffer
|
|
1651
|
+
// view 非 null 时,当然必须创建 Buffer
|
|
1603
1652
|
// 只有在 Buffer 为 null 时才新建,否则只能在 onVideoSizeChange 事件中重新申请 Buffer
|
|
1604
1653
|
if (!localVideoBuffer.buffer) {
|
|
1605
1654
|
localVideoBuffer.streamType = trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig;
|
|
@@ -1632,10 +1681,17 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
1632
1681
|
}
|
|
1633
1682
|
}
|
|
1634
1683
|
/**
|
|
1635
|
-
* 3.3
|
|
1684
|
+
* 3.3 暂停/恢复发布本地的视频流
|
|
1636
1685
|
*
|
|
1637
|
-
*
|
|
1638
|
-
*
|
|
1686
|
+
* 该接口可以暂停(或恢复)发布本地的视频画面,暂停之后,同一房间中的其他用户将无法继续看到自己画面。
|
|
1687
|
+
* 该接口在指定 TRTCVideoStreamTypeBig 时等效于 start/stopLocalPreview 这两个接口,但具有更好的响应速度。
|
|
1688
|
+
* 因为 start/stopLocalPreview 需要打开和关闭摄像头,而打开和关闭摄像头都是硬件设备相关的操作,非常耗时。
|
|
1689
|
+
* 相比之下,muteLocalVideo 只需要在软件层面对数据流进行暂停或者放行即可,因此效率更高,也更适合需要频繁打开关闭的场景。
|
|
1690
|
+
* 当暂停/恢复发布指定 TRTCVideoStreamTypeBig 后,同一房间中的其他用户将会收到 onUserVideoAvailable 回调通知。
|
|
1691
|
+
* 当暂停/恢复发布指定 TRTCVideoStreamTypeSub 后,同一房间中的其他用户将会收到 onUserSubStreamAvailable 回调通知。
|
|
1692
|
+
*
|
|
1693
|
+
* @param {Boolean} mute - true:屏蔽;false:开启,默认值:false
|
|
1694
|
+
* @param {TRTCVideoStreamType} streamType - 要暂停/恢复的视频流类型, 仅支持 TRTCVideoStreamTypeBig 和 TRTCVideoStreamTypeSub
|
|
1639
1695
|
*/
|
|
1640
1696
|
muteLocalVideo(mute, streamType) {
|
|
1641
1697
|
let newStreamType = streamType;
|
|
@@ -1647,7 +1703,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
1647
1703
|
/**
|
|
1648
1704
|
* 3.4 开始显示远端视频画面
|
|
1649
1705
|
*
|
|
1650
|
-
* 在收到 SDK 的 onUserVideoAvailable(userId,
|
|
1706
|
+
* 在收到 SDK 的 onUserVideoAvailable(userId, 1) 通知时,可以获知该远程用户开启了视频,
|
|
1651
1707
|
* 此后调用 startRemoteView(userId) 接口加载该用户的远程画面时,可以用 loading 动画优化加载过程中的等待体验。
|
|
1652
1708
|
* 待该用户的首帧画面开始显示时,您会收到 onFirstVideoFrame(userId) 事件回调。
|
|
1653
1709
|
*
|
|
@@ -1671,7 +1727,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
1671
1727
|
this._initRender(key, view);
|
|
1672
1728
|
}
|
|
1673
1729
|
// view 为 null 时,可能启动了自定义渲染,所以 Buffer 还是要创建,否则自定义渲染就拿不到数据;
|
|
1674
|
-
// view 非 null 时,当然必须创建 Buffer
|
|
1730
|
+
// view 非 null 时,当然必须创建 Buffer
|
|
1675
1731
|
const videoBufferInfo = {
|
|
1676
1732
|
userId: userId,
|
|
1677
1733
|
buffer: (0, util_1.allocBuffer)(DEFAULT_VIDEO_WIDTH * DEFAULT_VIDEO_HEIGHT * this.pixelLength, userId, streamType),
|
|
@@ -1855,7 +1911,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
1855
1911
|
}
|
|
1856
1912
|
}
|
|
1857
1913
|
/**
|
|
1858
|
-
* 3.13
|
|
1914
|
+
* 3.13 设置远端画面的渲染模式
|
|
1859
1915
|
*
|
|
1860
1916
|
* @param {String} userId - 用户 ID
|
|
1861
1917
|
* @param {TRTCVideoStreamType} streamType - 视频流类型
|
|
@@ -2097,7 +2153,11 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
2097
2153
|
this.rtcCloud.muteRemoteAudio(userId, mute);
|
|
2098
2154
|
}
|
|
2099
2155
|
/**
|
|
2100
|
-
* 4.5
|
|
2156
|
+
* 4.5 静音/取消静音所有远端用户的音频流
|
|
2157
|
+
*
|
|
2158
|
+
* 当您静音所有用户的远端音频时,SDK 会停止播放所有来自远端的音频流,同时也会停止拉取所有用户的音频数据。
|
|
2159
|
+
*
|
|
2160
|
+
* 注意:该接口支持您在进入房间(enterRoom)前调用,暂停状态会在退出房间(exitRoom)在之后会被重置。
|
|
2101
2161
|
*
|
|
2102
2162
|
* @param {Boolean} mute - true:静音;false:非静音
|
|
2103
2163
|
*/
|
|
@@ -2215,6 +2275,15 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
2215
2275
|
setAudioQuality(quality) {
|
|
2216
2276
|
this.audioQuality = quality;
|
|
2217
2277
|
}
|
|
2278
|
+
/**
|
|
2279
|
+
* 4.15 废弃接口:设置麦克风的音量大小
|
|
2280
|
+
*
|
|
2281
|
+
* @deprecated 从 TRTCSDK6.9 后该接口已被废弃,请使用 setAudioCaptureVolume 接口替代。
|
|
2282
|
+
* @param {Number} volume - 音量大小,100为正常音量,取值范围为0 - 200。
|
|
2283
|
+
*/
|
|
2284
|
+
setMicVolumeOnMixing(volume) {
|
|
2285
|
+
this.setAudioCaptureVolume(volume);
|
|
2286
|
+
}
|
|
2218
2287
|
/////////////////////////////////////////////////////////////////////////////////
|
|
2219
2288
|
//
|
|
2220
2289
|
// (五)摄像头相关接口函数
|
|
@@ -2224,7 +2293,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
2224
2293
|
* 5.1 获取摄像头设备列表
|
|
2225
2294
|
*
|
|
2226
2295
|
* @example
|
|
2227
|
-
* var cameralist =
|
|
2296
|
+
* var cameralist = rtcCloud.getCameraDevicesList();
|
|
2228
2297
|
* for (i=0;i<cameralist.length;i++) {
|
|
2229
2298
|
* var camera = cameralist[i];
|
|
2230
2299
|
* console.info("camera deviceName: " + camera.deviceName + " deviceId:" + camera.deviceId);
|
|
@@ -2259,7 +2328,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
2259
2328
|
* 6.1 获取麦克风设备列表
|
|
2260
2329
|
*
|
|
2261
2330
|
* @example
|
|
2262
|
-
* var miclist =
|
|
2331
|
+
* var miclist = rtcCloud.getMicDevicesList();
|
|
2263
2332
|
* for (i=0;i<miclist.length;i++) {
|
|
2264
2333
|
* var mic = miclist[i];
|
|
2265
2334
|
* console.info("mic deviceName: " + mic.deviceName + " deviceId:" + mic.deviceId);
|
|
@@ -2325,7 +2394,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
2325
2394
|
* 6.8 获取扬声器设备列表
|
|
2326
2395
|
*
|
|
2327
2396
|
* @example
|
|
2328
|
-
* var speakerlist =
|
|
2397
|
+
* var speakerlist = rtcCloud.getSpeakerDevicesList();
|
|
2329
2398
|
* for (i=0;i<speakerlist.length;i++) {
|
|
2330
2399
|
* var speaker = speakerlist[i];
|
|
2331
2400
|
* console.info("mic deviceName: " + speaker.deviceName + " deviceId:" + speaker.deviceId);
|
|
@@ -2354,10 +2423,6 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
2354
2423
|
/**
|
|
2355
2424
|
* 6.11 获取系统当前扬声器设备音量
|
|
2356
2425
|
*
|
|
2357
|
-
* 注意:
|
|
2358
|
-
* - SDK6.7 及以下版本,windows 查询的不是系统扬声器的音量大小,mac 是查询系统扬声器音量大小
|
|
2359
|
-
* - SDK6.8 及以上版本,windows 和 mac 查询的都是系统扬声器的音量大小
|
|
2360
|
-
*
|
|
2361
2426
|
* @return {Number} 扬声器音量,范围0 - 100
|
|
2362
2427
|
*/
|
|
2363
2428
|
getCurrentSpeakerVolume() {
|
|
@@ -2367,8 +2432,6 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
2367
2432
|
* 6.12 设置系统当前扬声器设备音量
|
|
2368
2433
|
*
|
|
2369
2434
|
* 注意:该接口的功能是调节系统播放音量,如果用户直接调节系统设置的播放音量时,该接口的设置结果会被用户的操作所覆盖。
|
|
2370
|
-
* - SDK6.7 及以下版本,windows 设置的不是系统扬声器的音量大小,mac 是设置系统扬声器音量大小
|
|
2371
|
-
* - SDK6.8 及以上版本,windows 和 mac 设置的都是系统扬声器的音量大小
|
|
2372
2435
|
*
|
|
2373
2436
|
* @param {Number} volume - 设置的扬声器音量,范围0 - 100
|
|
2374
2437
|
*/
|
|
@@ -2518,7 +2581,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
2518
2581
|
* 8.5 枚举可共享的窗口列表
|
|
2519
2582
|
*
|
|
2520
2583
|
* 如果您要给您的 App 增加屏幕分享功能,一般需要先显示一个窗口选择界面,这样用户可以选择希望分享的窗口。
|
|
2521
|
-
*
|
|
2584
|
+
* 通过此函数,您可以获得可分享窗口的 ID、类型、窗口名称以及缩略图。
|
|
2522
2585
|
* 拿到这些信息后,您就可以实现一个窗口选择界面,当然,您也可以使用我们在 Demo 源码中已经实现好的一个界面。
|
|
2523
2586
|
*
|
|
2524
2587
|
* 注意:返回的列表中包括屏幕和应用窗口,屏幕会在列表的前面几个元素中。
|
|
@@ -2564,6 +2627,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
2564
2627
|
* @param {Boolean} highlightWindow - 指定是否高亮正在共享的窗口,以及当捕获图像被遮挡时高亮遮挡窗口提示用户移走遮挡
|
|
2565
2628
|
*/
|
|
2566
2629
|
selectScreenCaptureTarget(source, captureRect, property, deprecatedCaptureRect, captureMouse, highlightWindow) {
|
|
2630
|
+
console.debug('trtc:selectScreenCaptureTarget:', source, captureRect, property, deprecatedCaptureRect, captureMouse, highlightWindow);
|
|
2567
2631
|
if (source.sourceId && captureRect instanceof trtc_define_1.Rect && property instanceof trtc_define_1.TRTCScreenCaptureProperty) {
|
|
2568
2632
|
const realSource = source;
|
|
2569
2633
|
return this.rtcCloud.selectScreenCaptureTarget(realSource.type, realSource.sourceId, realSource.sourceName, realSource.isMinimizeWindow, captureRect.left, captureRect.top, captureRect.right, captureRect.bottom, property.enableCaptureMouse, property.enableHighLight, property.enableHighPerformance, property.highLightColor, property.highLightWidth, property.enableCaptureChildWindow);
|
|
@@ -2583,7 +2647,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
2583
2647
|
}
|
|
2584
2648
|
}
|
|
2585
2649
|
/**
|
|
2586
|
-
* 8.7
|
|
2650
|
+
* 8.7 启动屏幕分享,支持选择使用主路或辅路进行屏幕分享。
|
|
2587
2651
|
*
|
|
2588
2652
|
* 注意:
|
|
2589
2653
|
* 一个用户同时最多只能上传一条主路(TRTCVideoStreamTypeBig)画面和一条辅路(TRTCVideoStreamTypeSub)画面,
|
|
@@ -2594,6 +2658,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
2594
2658
|
* @param {TRTCVideoEncParam} params 屏幕分享的画面编码参数,可以设置为 null,表示让 SDK 选择最佳的编码参数(分辨率、码率等)。即使在调用 startScreenCapture 时设置 type=TRTCVideoStreamTypeBig,依然可以使用此接口更新屏幕分享的编码参数。
|
|
2595
2659
|
*/
|
|
2596
2660
|
startScreenCapture(view = null, type = trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeSub, params = null) {
|
|
2661
|
+
console.debug('trtc:startScreenCapture:', view, type, params);
|
|
2597
2662
|
if ((type !== trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeSub && type !== trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig)) {
|
|
2598
2663
|
type = trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeSub;
|
|
2599
2664
|
}
|
|
@@ -2601,6 +2666,10 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
2601
2666
|
console.error('trtc:startScreenCapture, params is not instanceof TRTCVideoEncParam!');
|
|
2602
2667
|
return;
|
|
2603
2668
|
}
|
|
2669
|
+
if (this.isScreenCapturing && this.screenCaptureStreamType !== type && screenVideoBuffer.buffer) {
|
|
2670
|
+
// 已经在分享中,切换分享流类型,停止当前正在进行的分享
|
|
2671
|
+
this.stopScreenCapture();
|
|
2672
|
+
}
|
|
2604
2673
|
this.screenCaptureStreamType = type;
|
|
2605
2674
|
if (view !== undefined) {
|
|
2606
2675
|
if (view !== null) {
|
|
@@ -2638,12 +2707,14 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
2638
2707
|
this.screenCaptureStreamType = trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeSub;
|
|
2639
2708
|
}
|
|
2640
2709
|
/**
|
|
2641
|
-
* 8.11
|
|
2710
|
+
* 8.11 设置屏幕分享(即辅路)的视频编码参数
|
|
2642
2711
|
*
|
|
2643
|
-
*
|
|
2644
|
-
* -
|
|
2712
|
+
* 该接口可以设定远端用户所看到的屏幕分享(即辅路)的画面质量,同时也能决定云端录制出的视频文件中屏幕分享的画面质量。 请注意如下两个接口的差异:
|
|
2713
|
+
* - setVideoEncoderParam() 用于设置主路画面(TRTCVideoStreamTypeBig,一般用于摄像头)的视频编码参数。
|
|
2714
|
+
* - setSubStreamEncoderParam() 用于设置辅路画面(TRTCVideoStreamTypeSub,一般用于屏幕分享)的视频编码参数。
|
|
2645
2715
|
*
|
|
2646
|
-
*
|
|
2716
|
+
* 注意:
|
|
2717
|
+
* 即使您使用主路传输屏幕分享(在调用 startScreenCapture 时设置 type=TRTCVideoStreamTypeBig),依然要使用 setSubStreamEncoderParam 设定屏幕分享的编码参数,而不要使用 setVideoEncoderParam 。
|
|
2647
2718
|
*
|
|
2648
2719
|
* @param {TRTCVideoEncParam} params - 辅流(屏幕分享)编码参数
|
|
2649
2720
|
* @param {TRTCVideoResolution} params.videoResolution - 视频分辨率
|
|
@@ -3058,7 +3129,13 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
3058
3129
|
return this.rtcCloud.seekMusicToPosInTime(id, pts);
|
|
3059
3130
|
}
|
|
3060
3131
|
/**
|
|
3061
|
-
* 11.19
|
|
3132
|
+
* 11.19 设置所有背景音乐的本地音量和远端音量的大小
|
|
3133
|
+
*
|
|
3134
|
+
* 该接口可以设置所有背景音乐的本地音量和远端音量。
|
|
3135
|
+
* - 本地音量:即主播本地可以听到的背景音乐的音量大小。
|
|
3136
|
+
* - 远端音量:即观众端可以听到的背景音乐的音量大小。
|
|
3137
|
+
*
|
|
3138
|
+
* 注意:如果将 volume 设置成 100 之后感觉音量还是太小,可以将 volume 最大设置成 150,但超过 100 的 volume 会有爆音的风险,请谨慎操作。
|
|
3062
3139
|
*
|
|
3063
3140
|
* @param {Number} volume - 音量大小,100为正常音量,取值范围为0 - 200。
|
|
3064
3141
|
*/
|
|
@@ -3227,17 +3304,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
3227
3304
|
this.rtcCloud.stopSpeedTest();
|
|
3228
3305
|
}
|
|
3229
3306
|
/**
|
|
3230
|
-
* 13.3
|
|
3231
|
-
*
|
|
3232
|
-
* @param {TRTCDeviceType} deviceType - 设备类型
|
|
3233
|
-
* @param {Boolean} enable - 是否跟随系统默认的音频设备。 true:跟随, 当系统默认音频设备发生改变时,SDK 立即切换音频设备; false:不跟随, 只有当 SDK 使用的音频设备被移除后或插入新的音频设备为系统默认设备时,SDK 才切换至系统默认的音频设备。
|
|
3234
|
-
*
|
|
3235
|
-
*/
|
|
3236
|
-
enableFollowingDefaultAudioDevice(deviceType, enable) {
|
|
3237
|
-
this.rtcCloud.enableFollowingDefaultAudioDevice(deviceType, enable);
|
|
3238
|
-
}
|
|
3239
|
-
/**
|
|
3240
|
-
* 13.4 开始进行摄像头测试
|
|
3307
|
+
* 13.3 开始进行摄像头测试
|
|
3241
3308
|
*
|
|
3242
3309
|
* 会触发 onFirstVideoFrame 回调接口
|
|
3243
3310
|
*
|
|
@@ -3274,7 +3341,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
3274
3341
|
}
|
|
3275
3342
|
}
|
|
3276
3343
|
/**
|
|
3277
|
-
* 13.
|
|
3344
|
+
* 13.4 停止摄像头测试
|
|
3278
3345
|
*/
|
|
3279
3346
|
stopCameraDeviceTest() {
|
|
3280
3347
|
let key = this.getKey(CAMERA_DEVICE_TEST_VIEW, trtc_define_1.TRTCVideoStreamType.TRTCVideoStreamTypeBig);
|
|
@@ -3289,7 +3356,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
3289
3356
|
}
|
|
3290
3357
|
}
|
|
3291
3358
|
/**
|
|
3292
|
-
* 13.
|
|
3359
|
+
* 13.5 开始进行麦克风测试
|
|
3293
3360
|
*
|
|
3294
3361
|
* 回调接口 onTestMicVolume 获取测试数据
|
|
3295
3362
|
*
|
|
@@ -3301,13 +3368,13 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
3301
3368
|
this.rtcCloud.startMicDeviceTest(interval);
|
|
3302
3369
|
}
|
|
3303
3370
|
/**
|
|
3304
|
-
* 13.
|
|
3371
|
+
* 13.6 停止麦克风测试
|
|
3305
3372
|
*/
|
|
3306
3373
|
stopMicDeviceTest() {
|
|
3307
3374
|
this.rtcCloud.stopMicDeviceTest();
|
|
3308
3375
|
}
|
|
3309
3376
|
/**
|
|
3310
|
-
* 13.
|
|
3377
|
+
* 13.7 开始进行扬声器测试
|
|
3311
3378
|
*
|
|
3312
3379
|
* 回调接口 onTestSpeakerVolume 获取测试数据
|
|
3313
3380
|
*
|
|
@@ -3320,7 +3387,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
3320
3387
|
this.rtcCloud.startSpeakerDeviceTest(testAudioFilePath);
|
|
3321
3388
|
}
|
|
3322
3389
|
/**
|
|
3323
|
-
* 13.
|
|
3390
|
+
* 13.8 停止扬声器测试
|
|
3324
3391
|
*/
|
|
3325
3392
|
stopSpeakerDeviceTest() {
|
|
3326
3393
|
this.rtcCloud.stopSpeakerDeviceTest();
|
|
@@ -3409,25 +3476,16 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
3409
3476
|
// (十五) 废弃接口函数
|
|
3410
3477
|
//
|
|
3411
3478
|
/////////////////////////////////////////////////////////////////////////////////
|
|
3412
|
-
/**
|
|
3413
|
-
* 从 TRTCSDK6.9 后该接口已被废弃
|
|
3414
|
-
*
|
|
3415
|
-
* @deprecated 从 TRTCSDK6.9 后该接口已被废弃,请使用 setAudioCaptureVolume 接口替代。
|
|
3416
|
-
* @param {Number} volume - 音量大小,100为正常音量,取值范围为0 - 200。
|
|
3417
|
-
*/
|
|
3418
|
-
setMicVolumeOnMixing(volume) {
|
|
3419
|
-
this.setAudioCaptureVolume(volume);
|
|
3420
|
-
}
|
|
3421
3479
|
///------------------------内部方法-----------------------------
|
|
3422
3480
|
addLocalVideoRenderCallback() {
|
|
3423
|
-
if ([
|
|
3424
|
-
this.pixelformate = trtc_define_1.TRTCVideoPixelFormat.TRTCVideoPixelFormat_I420;
|
|
3425
|
-
this.pixelLength = 1.5;
|
|
3426
|
-
}
|
|
3427
|
-
else if (this.isExternalRenderEnabled || [3, 4, 6].indexOf(this.renderMode) !== -1) {
|
|
3481
|
+
if (this.isExternalRenderEnabled || [3, 4, 6].indexOf(this.renderMode) !== -1) {
|
|
3428
3482
|
this.pixelformate = trtc_define_1.TRTCVideoPixelFormat.TRTCVideoPixelFormat_RGBA32;
|
|
3429
3483
|
this.pixelLength = 4;
|
|
3430
3484
|
}
|
|
3485
|
+
else if ([1, 2, 5].indexOf(this.renderMode) !== -1) {
|
|
3486
|
+
this.pixelformate = trtc_define_1.TRTCVideoPixelFormat.TRTCVideoPixelFormat_I420;
|
|
3487
|
+
this.pixelLength = 1.5;
|
|
3488
|
+
}
|
|
3431
3489
|
else if ([7, 8].indexOf(this.renderMode) !== -1) {
|
|
3432
3490
|
this.pixelformate = trtc_define_1.TRTCVideoPixelFormat.TRTCVideoPixelFormat_BGRA32;
|
|
3433
3491
|
this.pixelLength = 4;
|
|
@@ -3446,14 +3504,14 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
3446
3504
|
}, this.pixelformate);
|
|
3447
3505
|
}
|
|
3448
3506
|
addRemoteVideoRenderCallback(userId) {
|
|
3449
|
-
if ([
|
|
3450
|
-
this.pixelformate = trtc_define_1.TRTCVideoPixelFormat.TRTCVideoPixelFormat_I420;
|
|
3451
|
-
this.pixelLength = 1.5;
|
|
3452
|
-
}
|
|
3453
|
-
else if (this.isExternalRenderEnabled || [3, 4, 6].indexOf(this.renderMode) !== -1) {
|
|
3507
|
+
if (this.isExternalRenderEnabled || [3, 4, 6].indexOf(this.renderMode) !== -1) {
|
|
3454
3508
|
this.pixelformate = trtc_define_1.TRTCVideoPixelFormat.TRTCVideoPixelFormat_RGBA32;
|
|
3455
3509
|
this.pixelLength = 4;
|
|
3456
3510
|
}
|
|
3511
|
+
else if ([1, 2, 5].indexOf(this.renderMode) !== -1) {
|
|
3512
|
+
this.pixelformate = trtc_define_1.TRTCVideoPixelFormat.TRTCVideoPixelFormat_I420;
|
|
3513
|
+
this.pixelLength = 1.5;
|
|
3514
|
+
}
|
|
3457
3515
|
else if ([7, 8].indexOf(this.renderMode) !== -1) {
|
|
3458
3516
|
this.pixelformate = trtc_define_1.TRTCVideoPixelFormat.TRTCVideoPixelFormat_BGRA32;
|
|
3459
3517
|
this.pixelLength = 4;
|
|
@@ -3496,14 +3554,14 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
3496
3554
|
this.streams.forEach((value, key, map) => {
|
|
3497
3555
|
oldStreams.set(key, value);
|
|
3498
3556
|
});
|
|
3499
|
-
if ([
|
|
3500
|
-
this.pixelformate = trtc_define_1.TRTCVideoPixelFormat.TRTCVideoPixelFormat_I420;
|
|
3501
|
-
this.pixelLength = 1.5;
|
|
3502
|
-
}
|
|
3503
|
-
else if (this.isExternalRenderEnabled || [3, 4, 6].indexOf(mode) !== -1) {
|
|
3557
|
+
if (this.isExternalRenderEnabled || [3, 4, 6].indexOf(mode) !== -1) {
|
|
3504
3558
|
this.pixelformate = trtc_define_1.TRTCVideoPixelFormat.TRTCVideoPixelFormat_RGBA32;
|
|
3505
3559
|
this.pixelLength = 4;
|
|
3506
3560
|
}
|
|
3561
|
+
else if ([1, 2, 5].indexOf(mode) !== -1) {
|
|
3562
|
+
this.pixelformate = trtc_define_1.TRTCVideoPixelFormat.TRTCVideoPixelFormat_I420;
|
|
3563
|
+
this.pixelLength = 1.5;
|
|
3564
|
+
}
|
|
3507
3565
|
else {
|
|
3508
3566
|
// 7,8
|
|
3509
3567
|
this.pixelformate = trtc_define_1.TRTCVideoPixelFormat.TRTCVideoPixelFormat_BGRA32;
|
|
@@ -3788,7 +3846,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
3788
3846
|
renderer = new Render_1.default.RGBRenderer(); // RGBA32 Canvas 2D
|
|
3789
3847
|
}
|
|
3790
3848
|
else if (this.renderMode === 4) {
|
|
3791
|
-
renderer = new Render_1.default.Canvas3DRGBARenderer(); // RGBA canvas 3D
|
|
3849
|
+
renderer = new Render_1.default.Canvas3DRGBARenderer(); // RGBA canvas 3D
|
|
3792
3850
|
}
|
|
3793
3851
|
else if (this.renderMode === 5) {
|
|
3794
3852
|
renderer = new Render_1.default.I420VideoRenderer(); // I420 video(html)
|
|
@@ -3867,7 +3925,7 @@ class TRTCCloud extends events_1.EventEmitter {
|
|
|
3867
3925
|
}
|
|
3868
3926
|
else if (format == trtc_define_1.TRTCVideoPixelFormat.TRTCVideoPixelFormat_BGRA32) {
|
|
3869
3927
|
if (this.renderMode !== 3) {
|
|
3870
|
-
videoframe.data = this._YUV2RGBA(width, height, data);
|
|
3928
|
+
videoframe.data = this._YUV2RGBA(width, height, data.buffer || data);
|
|
3871
3929
|
videoframe.length = width * height * 4;
|
|
3872
3930
|
callback(userid, streamType, videoframe);
|
|
3873
3931
|
}
|
package/liteav/trtc_define.d.ts
CHANGED
|
@@ -590,7 +590,7 @@ export declare class TRTCAudioRecordingParams {
|
|
|
590
590
|
constructor(filePath?: null | string, recordingContent?: TRTCAudioRecordingContent);
|
|
591
591
|
}
|
|
592
592
|
/**
|
|
593
|
-
* 5.
|
|
593
|
+
* 5.16 音效
|
|
594
594
|
*
|
|
595
595
|
* @param {Number} effectId - 【字段含义】音效 ID<br>
|
|
596
596
|
* 【特殊说明】SDK 允许播放多路音效,因此需要音效 ID 进行标记,用于控制音效的开始、停止、音量等
|
package/liteav/trtc_define.js
CHANGED
|
@@ -257,7 +257,7 @@ const TRTCVideoPixelFormat_HACK_JSDOC = {
|
|
|
257
257
|
// TRTCVideoPixelFormat_Texture_2D: 2,
|
|
258
258
|
/** BGRA32 */
|
|
259
259
|
TRTCVideoPixelFormat_BGRA32: 3,
|
|
260
|
-
|
|
260
|
+
// RGBA32
|
|
261
261
|
TRTCVideoPixelFormat_RGBA32: 5,
|
|
262
262
|
TRTCVideoPixelFormat_H264: 6,
|
|
263
263
|
};
|
|
@@ -1199,7 +1199,7 @@ class TRTCAudioRecordingParams {
|
|
|
1199
1199
|
exports.TRTCAudioRecordingParams = TRTCAudioRecordingParams;
|
|
1200
1200
|
;
|
|
1201
1201
|
/**
|
|
1202
|
-
* 5.
|
|
1202
|
+
* 5.16 音效
|
|
1203
1203
|
*
|
|
1204
1204
|
* @param {Number} effectId - 【字段含义】音效 ID<br>
|
|
1205
1205
|
* 【特殊说明】SDK 允许播放多路音效,因此需要音效 ID 进行标记,用于控制音效的开始、停止、音量等
|
package/package.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trtc-electron-sdk",
|
|
3
|
-
"version": "10.3.
|
|
3
|
+
"version": "10.3.401-beta.2",
|
|
4
4
|
"description": "trtc electron sdk",
|
|
5
5
|
"main": "./liteav/trtc.js",
|
|
6
6
|
"types": "./liteav/trtc.d.ts",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"cos-nodejs-sdk-v5": "^2.8.2",
|
|
9
|
-
"download": "^8.0.0",
|
|
10
9
|
"events": "^3.2.0",
|
|
11
|
-
"fs-extra": "^9.0.1",
|
|
12
|
-
"fs-sync": "^1.0.6",
|
|
13
10
|
"lodash.isequal": "^4.5.0",
|
|
14
|
-
"rimraf": "^3.0.2",
|
|
15
|
-
"semver": "^6.0.0",
|
|
16
|
-
"signale": "^1.4.0",
|
|
17
11
|
"yuv-buffer": "^1.0.0",
|
|
18
|
-
"yuv-canvas": "^1.2.
|
|
12
|
+
"yuv-canvas": "^1.2.6",
|
|
13
|
+
"download": "^8.0.0",
|
|
14
|
+
"fs-sync": "^1.0.6",
|
|
15
|
+
"fs-extra": "^9.0.1",
|
|
16
|
+
"signale": "^1.4.0",
|
|
17
|
+
"rimraf": "^3.0.2",
|
|
18
|
+
"semver": "^6.0.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@babel/cli": "^7.11.6",
|
|
@@ -42,7 +42,9 @@
|
|
|
42
42
|
"copy:types": "node ./scripts/copy-types.js",
|
|
43
43
|
"publish_doc": "node ./scripts/publish-doc.js",
|
|
44
44
|
"doc": "npm run doc:clean && npm run doc:build",
|
|
45
|
-
"doc:build": "
|
|
45
|
+
"doc:build": "npm run doc:build-zh && npm run doc:build-en",
|
|
46
|
+
"doc:build-zh": "./node_modules/.bin/jsdoc -c ./jsdoc/jsdoc_zh.json && node ./jsdoc/fix-doc_zh.js",
|
|
47
|
+
"doc:build-en": "./node_modules/.bin/jsdoc -c ./jsdoc/jsdoc_en.json && node ./jsdoc/fix-doc_en.js",
|
|
46
48
|
"doc:clean": "node ./jsdoc/clean-doc.js",
|
|
47
49
|
"prerelease": "npm run build && npm run doc && node ./scripts/prerelase.js",
|
|
48
50
|
"publish_npm": "node scripts/publish-npm.js"
|
package/scripts/download.js
CHANGED
|
@@ -11,7 +11,6 @@ const {
|
|
|
11
11
|
detectOwnVersion,
|
|
12
12
|
detectOwnName,
|
|
13
13
|
} = require('./utils');
|
|
14
|
-
const { Platform } = require('./constant');
|
|
15
14
|
|
|
16
15
|
const buildDownloadInfo = () => {
|
|
17
16
|
const configArgv = Object.assign({}, readCliArgv(), readArgvFromNpmEnv());
|
|
@@ -34,7 +33,6 @@ const buildDownloadInfo = () => {
|
|
|
34
33
|
};
|
|
35
34
|
};
|
|
36
35
|
|
|
37
|
-
let downloadFrameworkSuccessCount = 0;
|
|
38
36
|
const main = () => {
|
|
39
37
|
const {
|
|
40
38
|
packageVersion,
|
|
@@ -71,12 +69,6 @@ const main = () => {
|
|
|
71
69
|
.then(() => {
|
|
72
70
|
console.log('copy success!');
|
|
73
71
|
rimraf.sync(outputDir);
|
|
74
|
-
if (platform === Platform.MACOS) {
|
|
75
|
-
const txFFmpegUrl = 'https://web.sdk.qcloud.com/trtc/electron/download/trtc-electron-sdk/mac-framework/TXFFmpeg.framework.zip';
|
|
76
|
-
const txSoundTouchUrl = 'https://web.sdk.qcloud.com/trtc/electron/download/trtc-electron-sdk/mac-framework/TXSoundTouch.framework.zip';
|
|
77
|
-
downloadFramework(txFFmpegUrl, outputDir, buildDir);
|
|
78
|
-
downloadFramework(txSoundTouchUrl, outputDir, buildDir);
|
|
79
|
-
}
|
|
80
72
|
})
|
|
81
73
|
.catch(err => console.error(err));
|
|
82
74
|
}).catch(err => {
|
|
@@ -85,23 +77,4 @@ const main = () => {
|
|
|
85
77
|
});
|
|
86
78
|
};
|
|
87
79
|
|
|
88
|
-
const downloadFramework = (url, outputDir, buildDir) => {
|
|
89
|
-
download(url, outputDir, {
|
|
90
|
-
strip: 0,
|
|
91
|
-
extract: true
|
|
92
|
-
}).then(() => {
|
|
93
|
-
signale.success('Success', 'Download framework finished');
|
|
94
|
-
downloadFrameworkSuccessCount++;
|
|
95
|
-
rimraf.sync(path.join(outputDir, '__MACOSX'));
|
|
96
|
-
const frameworkPath = path.join(buildDir, 'mac-framework');
|
|
97
|
-
fs.mkdirpSync(frameworkPath);
|
|
98
|
-
if (downloadFrameworkSuccessCount === 2) {
|
|
99
|
-
fs.copySync(path.join(outputDir), frameworkPath);
|
|
100
|
-
rimraf.sync(outputDir);
|
|
101
|
-
}
|
|
102
|
-
}).catch(err => {
|
|
103
|
-
signale.fatal('Failed', err);
|
|
104
|
-
});
|
|
105
|
-
};
|
|
106
|
-
|
|
107
80
|
main();
|
package/scripts/prerelase.js
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
2
|
const {copy, remove} = require('fs-sync');
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
|
|
5
|
+
const liteavPath = path.join(__dirname, '../liteav');
|
|
6
|
+
const liteavFiles = fs.readdirSync(liteavPath, {withFileTypes: true});
|
|
7
|
+
liteavFiles.forEach(file => {
|
|
8
|
+
if (file.isFile() && file.name.indexOf('_en.') !== -1) {
|
|
9
|
+
const filePath = path.join(liteavPath, file.name);
|
|
10
|
+
console.log(`Remove en files not to be published: `, filePath);
|
|
11
|
+
remove(filePath);
|
|
12
|
+
}
|
|
13
|
+
});
|
|
3
14
|
|
|
4
15
|
remove('./npm');
|
|
5
16
|
copy(path.resolve('./liteav'), path.resolve('./npm/liteav'));
|
package/scripts/publish-doc.js
CHANGED
|
@@ -34,7 +34,7 @@ const cos = new COS({
|
|
|
34
34
|
|
|
35
35
|
const bucket = 'sdk-web-1252463788';
|
|
36
36
|
const region = 'ap-hongkong';
|
|
37
|
-
const keyPrefix = 'trtc/electron/doc/
|
|
37
|
+
const keyPrefix = 'trtc/electron/doc/';
|
|
38
38
|
const docPath = path.join(__dirname, '../_doc');
|
|
39
39
|
|
|
40
40
|
function walkSync(dir, filelist) {
|